Decrease physical size when displaying image

Asked

Viewed 97 times

2

I need a way to compress the size of an image that I receive from a third party, that is, I receive the link with the path of an image and I have to show it on my website.

The main problem is that these images are very large and I need to upload one thumbnail of them, as are various images to upload the site gets very slow.

Note: I do not intend to compress and download the images to my server, I need to open them directly from the path that is sent to me.

Does anyone have any tips?

  • 1

    post some attempt by you to demonstrate interest, the way this is like a request "Do it for me"

  • In what language?

  • Php, html, Javascript, CSS - Foundation

  • Hi Otto, sorry not to post a try, it happens usually if you use 3 image sizes and if you use one according to screen size, bandwidth speed among others... It turns out that I only have a large image that comes from a third one (not on our server) and I want to load it in a compressed form to load a Thumb quickly.

  • @Vitor you tried something?

  • @Try to use that page it compresses from link, suggest vc creates a function in php...

  • Herbert, we actually actually actually take the image on this other server and show it directly by resizing, we don’t know what to do to show this image responsibly. We searched how to show the image responsibly and the only thing we found was to have 3 versions of the image. However, we only have one version of the image that is not on our server. We cannot, for example, use PICTUREFILL or PICTURE ELEMENT. In short, I need to show a Thumb of an image that I get large from another server responsively on my site.

  • You can decrease the images with the function [imagecopyresized] (http://php.net/manual/en/function.imagecopyresized.php) of the GD extension for image processing, in the documentation there are some examples that you can use

  • I think I would do using Imagemagick and a little robot that would download the link, reduce and store the diminished result.

Show 4 more comments

1 answer

1

I think a solution would be to make use of cache, but in this way would be created a cache folder on the server, An interesting plug I’ve used Gregwar’s Image , with it it is possible to resize an image and save in a cache folder greatly improving the loading of pages.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.