Can phpthumbof maintain aspect ratio?

All I need to do is set the width to 600px but I want the height to maintain proper aspect ratio, it doesn’t seem to have any options to do this. I’ve read every doc I can find and search old and new forums. Maybe I’m missing something but it seems like I shouldn’t be the only person who doesn’t actually want to crop images in both directions?

Is this possible? Or is there a different resizer where I can set a max width only?

I usually do a combination with a Image+ TV (for setting an aspect ratio) and pThumb (for the desired width).

<img src="[[ImagePlus?&value=`[[*imageplusTV]]`&options=`w=800`]]" />

Doesn’t providing just the width (eg &w=600) to any of the available thumbnailing plugins make it keep the ratio but scale it down to that width?

Also see $zc=1 and &aoe=1.

yes

thats what i always did… just supply one of the values I care about and the other will automatically size in apsect ratio

What happens if you set zc=0

Sorry all, it is correct that only providing one value w=500 by itself did the trick. I had used zc=1 but the client didn’t want the image changed in any way whatsover (it’s artwork). But it was visually still wrong until I realize it was only the grid itself cutting off images due to object-fit:cover.

When I was testing, I right-clicked an opened the image in a new tab and it looked correct, the client was saying it’s wrong. But it was only the object-fit that was wrong. I changed it to “contain” and they are happy.

This document was the most helpful figuring out the phpthumbof options. http://phpthumb.sourceforge.net/demo/docs/phpthumb.readme.txt

2 Likes