Users join a site I’m building and will update an image (or several).
The image (especially if main image – any any image can be this or changed to this) the image will be displayed in different sizes – total of 5 different sizes.
1 - full original image - lightbox image
2. - cropped large - main profile image
3. - cropped medium - search image
4. - cropped smaller - display of multiple users image
5. - cropped very small - chat image
All images will be changed to jpg and compressed to 80% and the user will do the cropping using Jcrop.
I wanted to know what would be the most efficient method to have these images.
My current plan is to save the original and post crop create 4 more images.
This means for each image there will be 5 images.
Is there a better way to do this?
Should I make the last 3 (3/4/5) all be the same image just sized differently with CSS?
I’ve heard about a PHP function to change the image size on the fly but I’ve also heard this is heavy on the processing and might be inefficient in its own way.
thoughts? advice?
thankyou
Your solutions sounds right. Store somewhere image resize settings, then upload image, create required images, crop, resize etc. Keep the original, so in case later you will need to add another size or make other changes.
You could only store original file name into database, like
image.jpg, then before displaying add specific resized image prefix like:image_croped_large.jp.As of choosing CSS i would resize images, won’t use CSS , because image quality will be better, and image size will probably be smaller.
And it’s cheaper to store few more images, than download big pictures.