ZenphotoCMS Forum
image size - max height and max width - fit inside - Printable Version

+- ZenphotoCMS Forum (https://forum.zenphoto.org)
+-- Forum: Support (https://forum.zenphoto.org/forum-1.html)
+--- Forum: General support (https://forum.zenphoto.org/forum-4.html)
+--- Thread: image size - max height and max width - fit inside (/thread-3650.html)



image size - max height and max width - fit inside - kjtooke - 2008-08-31

For main image (not full size, not thumb), it would be useful to be able to set a maximum canvas area that the image can use.

Currently, image size is either set by width or longest edge.

This feature would effectively also allow it to be set by height.




image size - max height and max width - fit inside - sterk - 2008-08-31

printCustomSizedImage
printCustomSizedImageMaxHeight




image size - max height and max width - fit inside - acrylian - 2008-08-31

printCustomSizedImageMaxHeight is somehow considered as depractated and that functionality is already on the to do list.

Meanwhile you could try this code that is more reliable than the function above on your image.php (works for thumbnails except album thumbs, too):
if (getFullWidth() === getFullHeight() OR getFullWidth() > getFullHeight()) { printCustomSizedImage(getImageTitle(), null, , null); } else { printCustomSizedImage(getImageTitle(), null, null , ); }




image size - max height and max width - fit inside - kjtooke - 2008-08-31

I'll try that...

Thanks




image size - max height and max width - fit inside - kjtooke - 2008-08-31


That works, thanks again...


-)





image size - max height and max width - fit inside - kjtooke - 2008-08-31

The only downside I have found with this temporary code is that the watermark is scaled...




image size - max height and max width - fit inside - sterk - 2008-08-31

according to:

http://www.zenphoto.org/documentation/functions/_template-functions.php.html#functionprintCustomSizedImage

you can turn the watermark off, but it's not working for me. i tried:




image size - max height and max width - fit inside - sbillard - 2008-08-31

Did you clear your cache? If the image is already cached with a watermark, no amount of code changes will get rid of it, only a cache clear.




image size - max height and max width - fit inside - sterk - 2008-08-31

yes i cleared the cache. the new created tumbnails still have the watermark with this code:




image size - max height and max width - fit inside - sbillard - 2008-08-31

Congratulations, you forced me to go read the document. Maybe you should have done so as well: bool $thumbStandin: set true to inhibit watermarking




image size - max height and max width - fit inside - sterk - 2008-08-31

alright, english is not my first language and i struggled with the word "inhibit" (thought it was something like "include"), therefore i tried both false and true, only with true i didnt clear the cache.

but it's working now properly and i learned a new word, damn you guys are good




image size - max height and max width - fit inside - acrylian - 2008-09-01

Sterk, I had to look into a dictionary as well, since english is not my first language, too..:-)