Handling images properly in PHP
Posted: Mon Mar 12, 2007 4:28 pm
Hi,
I have some product images, with the source image consistently of 800 pixels in width, and varied height depending upon the image's proportions.
I want to show these same images at different sizes depending on the page - anything from 150 pixel thumbnail to 800 pixel fullsize.
I don't want to resample the image, and save to a different file for all of the 3-4 sizes I want to display the image at, as it will take up a lot of server space per image.
I also don't want to force the width of the image using the img tag property 'width', because this will always require the loading of the full size image each time the page is loaded, only it will simply be displayed at a smaller size.
Resampling on-demand seems to be an option, but doubtful...
What is the 'best' way, i.e. the one that has won in the market of ideas?
Many thanks
I have some product images, with the source image consistently of 800 pixels in width, and varied height depending upon the image's proportions.
I want to show these same images at different sizes depending on the page - anything from 150 pixel thumbnail to 800 pixel fullsize.
I don't want to resample the image, and save to a different file for all of the 3-4 sizes I want to display the image at, as it will take up a lot of server space per image.
I also don't want to force the width of the image using the img tag property 'width', because this will always require the loading of the full size image each time the page is loaded, only it will simply be displayed at a smaller size.
Resampling on-demand seems to be an option, but doubtful...
What is the 'best' way, i.e. the one that has won in the market of ideas?
Many thanks