"Get Image Size" action incorrect height

Wappler Version : 5.2.2
Operating System : Windows 11
Server Model: NodeJS
Database Type: MariaDB

Expected behavior

What do you think should happen?

Using the “Get Image size” Action to obtain the “height” of the image, allow to implement conditions for resize, etc., based on “height”.

Actual behavior

What actually happens?

Server side, backend for PC only, so, no smartphone use to upload image: “Get Image Size” Action always obtain the height as width for vertical image.

A landscape image of 3000x2000 (width x height) it get recognize as width and height, that’s Ok.

width: 3000
height: 2000

A vertical image of 2000x3000 (width x height) it get recognize the height as width and width as height, that’s Not Ok. I can’t obtain the real height of the image if it is vertical.

width: 3000
height: 2000

Not matter if Auto Orientation is enable or not.

How to reproduce

  • Detail a step by step guide to reproduce the issue
  • A screenshot or short video indicating the problem
  • A copy of your code would help. Include: JS, HTML.
  • Test your steps on a clean page to see if you still have an issue

-File Upload
-Get Image Size

Could you upload those images here in a zip file for testing?

Of course, I see that the issue comes with image download from smartphone camera, and trying to use the same file in File Upload plugin.
If the same file is exported as a new file using i.e. photoshop or other without all the original metadata the file is recognize without problem. But the original not detected the width and height proppertly

images.zip (12.5 MB)

I’ve checked the images on the site https://jimpl.com/. It shows 4624 x 2604 for the original while the others have size 2604 x 4624. It has however the exif information in the original for the orientation.

Please test following update: image.zip (2.9 KB) unzip to lib/modules.

Sorry, it’s the same.
Only with the file original.jpg is the issue, the other one not.

image

New update: image.zip (2.9 KB) unzip to lib/modules .

New file loaded as you can see here and highlighting the new change in your file image.js:

Clearing cache in browser just in case, but, sorry, nothing. :cry:

What is the action that you use? It is the load action that has been updated to return the correct metadata after the auto orientation. The getImageSize action wasn’t updated and will return the image size without taking orientation into account.

You are right, sorry for that, with Load Image works with last update.

Using Auto Orient works with last update.

I think that getImageSize need to be updates too.

Thanks

Fixed in Wappler 5.2.3

This topic was automatically closed after 2 days. New replies are no longer allowed.