How to resize an image with only the source URL, not the original file?

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

How to resize an image with only the source URL, not the original file?

TrevorSaldana
This post was updated on .
I'm developing a new frontend for a community-style website where users can upload their own posts, including images. Images are uploaded directly to an AWS S3 storage bucket, and then the source URL is stored in a database.

The previous development team did not use any sort of image optimization on initial upload, so when I'm receiving the S3 source URLs from our backend, the image size can range from small (300px widths) to massive (5000px widths). As a result, the frontend's feed of user posts has intermittent loading times as the browser takes time to load these massive images in the feed https://xvideos.onl/ https://xnxx.onl/ https://ixxx.onl/


I'm wondering if there's any way I can do some nifty work to "resize" or otherwise optimize an image using only the source URL. From what I understand, in most cases I'd need the original file for any size optimizations, but maybe someone here knows a trick I'm overlooking.
Reply | Threaded
Open this post in threaded view
|

Re: How to resize an image with only the source URL, not the original file?

gouessej
Administrator
Hello

There's no magical solution. I advise you to resize the images in your storage bucket, to modify the upload process to store a small copy of each original file and to use the source URL of the small copy. If you use the source URL of the original file, the web browser will try to download it fully even though you use a CSS rule to show only a small portion of it.
Julien Gouesse | Personal blog | Website