Customizing/Refining Image Max Size

coleorloff / 2016-05-30 15:51:30   

Selecting 700px as IMAGE MAX SIZE in Over and Over resizes the maximum dimension of an image to 700px. I.e. the max width of a horizontal image becomes 700px and the max height of a vertical image also becomes 700px.

I'd like to change the image max size settings so that the resizing to 700px only effects width of an image. So that vertical images can be 700px wide.

CSS solutions are fine, but I don't mind diving into the source code to find out where those max values are set. Can anyone point me in the right direction?

Thanks!

Vaska A / 2016-05-30 20:46:41   

The easiest way to do this is simply with CSS on the frontend. Just make your own theme, et voila...

coleorloff / 2016-05-30 21:48:28   

I appreciate you taking the time to respond!

And I'm theming up right now actually...

On mobile, I added some css and it's working quite nicely – everything ends up at the same width (both vertical images and horizontal images).

But on desktop I don't think CSS will work because vertically-oriented images and horizontally-oriented images never have the same horizontal axis length. In this case it's because I'm using Over and Over to set the max image sizes and then using No Show + dropping the images in the provided field to create each page layout.

I could resize all the photos and then re-upload them but because Indexhibit already works so well and it's probably quicker in the long run, I'd rather limit the image sizes with the backend then go through and re-edit every image.

If you can let me know where this all happens in the source or why vertically-oriented images get their vertical axis cut down when you set the max size instead of the horizontal axis that would be a great place to start.

Again, thanks.

Vaska A / 2016-05-31 00:23:34   

It works via a "bounding box" - not horizontal or vertical but the one which is most. Chaning that...is a bitch.

CSS is the way to go.

coleorloff / 2016-05-31 00:39:05   

Right on.

Thanks for the help.

Vaska A / 2016-05-31 01:11:47   

However, if you dig through the /ndxzsite/config/options.php file you will find that you can change default image sizes. 700px might not be enough...change it to what you need (and what your webhost can handle).

LauraElina / 2018-08-17 09:14:58   

Hi,

Sorry but I'm not sure if I understand the advice provided above – if I should use CSS for changing the max image size what file should I work on?

If I should modify the options.php instead, what do the different values are for? Width, height and?:

$default['imagesize'] = array(700 => 700, 800 => 800, 900 => 900, 'full' => 9999);

Many thanks in advance!
Laura

Vaska A / 2018-08-17 09:55:04   

/ndxzsite/config/options.php

The values represent a square (bounding box) - resizing fits into them along the largest dimension of your image. Don't change the 9999 value...

;)

LauraElina / 2018-08-17 10:31:03   

Many thanks for your quick reply Vaska!

However, I still don't get it – I tried to upload an image the longer side of which was 900, and the system informed me that the file is too big.

When I changed it to 700, I had no issues. So I don't understand why there are different values and what I should change exactly.

Thanks again!

Vaska A / 2018-08-17 10:53:59   

Because it's too big in kilobytes. Which is not the same as number of pixels - totally different things.

LauraElina / 2018-08-17 11:18:19   

??? Sorry now I'm even more confused. The values are for the dimensions, but then the KB amount matters? And where do I change that?

If I try to upload an image that is 564.77KB (900px longer side), I get a message 'Error File is too big'.

LauraElina / 2018-08-17 13:49:55   

Ok found it.

LauraElina / 2018-08-18 08:18:06   

PS. Just out of curiosity, what the different values "array(700 => 700, 800 => 800, 900 => 900, 'full' => 9999)" are for?

Thanks!

This thread has been closed, thank you.