you could add a force same height option where the images dont get croped but only scaled to have the same height.
this would be usefull for a strip like gallery

Comments

darren oh’s picture

Title: force same height » Set Height Only
Project: Image Exact Sizes » Image
Version: master » 4.7.x-1.x-dev
Component: Miscellaneous » image.module

The image module already works like this. It only needs to be modified to not require both height and width to be set.

darren oh’s picture

Until someone submits a patch, you could disable the Image Exact Sizes module and choose an image width larger than the screen in your image settings. That will make all your images the same height as long as none of your images are extremely wide and short.

gordon’s picture

Status: Active » Needs review
StatusFileSize
new1.09 KB

He is a patch that will do both fixed width and fixed height.

To enable this, just leave the height or width parameter of the image empty and it will calculate it.

mariagwyn’s picture

I happened on this discussion, as I needed to set single dimension image uploads. I installed the patch, and it seems to be working fine, though I have only experimented a bit. I will let you know if problems crop up.

Thanks for the unwitting help!

Maria

darren oh’s picture

It doesn't work for me. When I set width only, I get an error message, but the thumbnail is created. When I set height only, I get an error message and no thumbnail is created. These are the error messages:

Width Only

warning: in_array() [function.in-array]: Wrong datatype for second argument in /home/darrenoh/public_html/modules/ecommerce/product/product.module on line 704.
warning: in_array() [function.in-array]: Wrong datatype for second argument in /home/darrenoh/public_html/modules/ecommerce/product/product.module on line 190.

Height Only

The selected file could not be copied, because no file by that name exists. Please check that you supplied the correct filename.
darren oh’s picture

Status: Needs review » Needs work

I had the image exact sizes module installed. Without it, leaving height blank works. Leaving width blank still doesn't work.

gordon’s picture

Status: Needs work » Needs review

These are not bugs with the image module.

I have this patch running perfectly on 4.7 with E-Commece

darren oh’s picture

StatusFileSize
new882 bytes

The problem was in this section of the patch:

+      elseif ($size['height'] && !$size['width']) {
+        $size['width'] = (int)round($size['width'] / $aspect);
+      }

As you can see, it says to calculate the width from the width if no width is given, whereas it should say to calculate the width from the height. It works perfectly once this is corrected. I'm attaching an updated patch.

darren oh’s picture

Status: Needs review » Reviewed & tested by the community

The patch has been working for me with no problem.

darren oh’s picture

Title: Set Height Only » Allow Fixed Height or Width
walkah’s picture

Status: Reviewed & tested by the community » Fixed

committed. thanks Darren!

Anonymous’s picture

Status: Fixed » Closed (fixed)