How can I get an image or element width and height?

I’m trying to limited the height of the portrait image object, and for the landscape I’ll use a built-in image element with an auto-adjust element height option,

to do this I think I need to check the image width and height so the app can pick the right image frame for each image.

I have tried the metadata plug-in both paid and free it still give me a wrong pixel dimension,
image from phone camera always read a lower number as an image height in the portrait orientation image.

Or is there a way to get the element height instead of image height?

example image


the actual width is 3024 and 4032 is for height, but I get 3024 as an image height instead.

Thanks

Quite a clunky way … but you can use one of the Algorithmia APIs to give you this…

I’ve noticed Zeroqode have something that should do the trick…


You can run a quick test here

3 Likes

If your coding skills are up to it … should be fairly simple to do a server side plugin based on this Node module.

Works great on 1x image upload, but can’t get it to work on multi image uploads. Any other suggestions would be welcome :slight_smile:

For anyone looking, this plugin works great Image Metadata Plugin | Bubble

3 Likes

Thanks for this recommendation. Yes, I will second it. Works like a charm, another winner from Coaching No Code Apps!

1 Like