View ThreadPost ResponseReturn to IndexRead Prev MsgRead Next Msg |
With all the uploaded files safely backed up, I read up on how to resize images using PHP. It's a little harder than I anticipated, but I managed to figure out how to resize GIF, JPEG, and PNG files to a specified width. To keep images proportional, I calculated the new height based on the ratio, algebraically
$ratio = $new_width / $width;
$new_height = $height * $ratio;
Reading articles about images for the web, recommendations were to keep them around 1200px wide or less, so I used that, and ran my little script to resize all uploaded files that were greater than 1200px wide.
Note that this is not real-time, but only resizes existing images when I run the script, which will hopefully make them load faster with no significant loss of resolution.
That is my main concern for now...did the resolution suffer? Is it better to just always use the full-size images, regardless of size?
Either way is fine, Storage is relatively cheap, so the impetus to reduce image file sizes is mainly to save bandwidth and increase page load times for those with less-than-optimal connections.
Feedback welcome.
View ThreadPost ResponseReturn to IndexRead Prev MsgRead Next Msg |
Feedback is maintained by Ellis Walentine