#Best practice / options for resizing and optimizing user image uploads that are displayed on site?

2 messages · Page 1 of 1 (latest)

sudden pumice
#

Example: site has a blog post with a banner image, user uploads a 10mb image that you have to resize somehow otherwise the page will be slow.
how do most small teams handle this?

Are you resizing the image on your server? Or in JS before it's even uploaded?
How do you handle generation and storage of additional image sizes? (ie thumbnail/mobile/tablet size images)
How do you handle calling the the correct size image out in html? (assuming you have generated additional sizes)

In the past we have mostly just done basic resizing of a single image in php, but I would like to find out if there's a better solution we could easily implement

Our team only has a few developers, and the number of projects/sites that need this feature greatly outnumber us so looking for ease of use/setup

Thanks

north haven
#

Depending on image requirements, sometimes a simple resize on the server is good enough. If you need images to be in a specific aspect ratio for example, having a client-side cropping library helps a ton. I used Cropper.js recently and it was easy enough to implement