How do I setup the max width or max height of an image?

Renegade

Well-known member
I want to limit the size of the images being displayed on an add-on. If the image is too wide then the max width parameter should limit the dimension but keep the original proportions intact.

My second question is, how can I resize the image to a set height or width (depending on whichever is higher) while uploading.

Any guidance is greatly appreciated. :)
 
Just set a max width (and height) value in the ACP.

Options -> Attachments -> Maximum Attachment Image Dimensions

Any images over those dimensions will be resized down to match, with the ratio being maintained.

Resizing of smaller images up to the dimensions set in the ACP isn't performed.
 
No I don't want to set this throughout the board but for a specific template. That's why I didn't post it in XF support myself.

On a particular template there is a set of code which outputs the images on a page. I want to set this limitation there.
 
Is this for an existing add-on or one you are developing?

I can move the thread to development questions if that's more appropriate?
 
Not for an existing add-on. Something that I was getting developed and now this particular functionality seems out of scope to the developer. So you can say something that I am developing :P
 
Top Bottom