WC logo MENU
View ThreadPost ResponseReturn to IndexRead Prev MsgRead Next Msg
Re: picture Question
Posted By Peter
Date Friday, 27 May 2022, at 3:56 p.m.

In Response To picture Question (William Tindall)

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.


Messages In This Thread

Post Response

Your Name
Your E-Mail Address
If you'd like to have the option of deleting your post later, please provide a password (CASE SENSITIVE!):
 If you'd like e-mail notification of responses, please check this box
Accept Terms of Service

View ThreadPost ResponseReturn to IndexRead Prev MsgRead Next Msg

Frequently Asked Questions on using forums

Shop Amazon using this affiliate link, and Amazon will pay WoodCentral a commission on anything you buy. The commission is used in paying the costs of maintaining this site, and the price you pay on Amazon is NOT affected by using this link.

Messages Hand Tools Turning Classifieds Feedback SANDBOX
Copyright © 1998-2022 by Ellis Walentine. All rights reserved.
No parts of this web site may be reproduced in any form or by any meanswithout the written permission of the publisher.