Image height and width are inverted in Ubuntu vs Windows

Given this image, I tried to read the image height and width in pixel values, but they are inverted on my Ubuntu PC (Ubuntu 20.04.3 LTS). When I open the image to visualize it, is clear that height > width.

Windows gets it right though:

enter image description here

So width should be 336 and height 448.

On Ubuntu I tried (one needs imagemagick installed, so if needed: sudo apt-get install imagemagick):

wget
identify -format '%h %w' 2075125.jpg
# gives 336 448 and it should be 448 336

I also tried other tools, thinking that maybe is an imagemagick issue:

sudo apt install libimage-size-perl # for imgsize
imgsize 2075125.jpg
# width="448" height="336" # same issue

or

sudo apt install libimage-exiftool-perl
exiftool -ImageHeight -ImageWidth 2075125.jpg
# Image Height : 336
# Image Width : 448

I don't understand what is the issue here and I would appreciate help.

1 Reset to default

Know someone who can answer? Share a link to this question via email, Twitter, or Facebook.

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

You Might Also Like