Is there a php function which will do image resizing math itself but not create a new file?
I created a simple proportionally-resize-an-image math script and I realized there is more to it than just geometry, such as aspect ratio and such. Basic geometry math squashes the image a little.
If anyone is curious, it's simply to give the user a preview of image dimensions should they choose to download, but I'd rather not clutter up the server with tons of size variations of similar images :D.
Thanks.
edit: Per request, here is the key part of the resizing code:
$ratio = min( $resize_to / $width, $resize_to/ $height );
$width = $ratio * $width;
$height = $ratio * $height;
When I see the values output, I simply do a resize in photoshop using the values and the photoshop version squashes (I do this as a visual test), so I assume my code is faulty.