Picture in Portrait Mode is Automatically Landscaped

Mac OSX specific forum
User avatar
fsw
Addict
Addict
Posts: 1572
Joined: Tue Apr 29, 2003 9:18 pm
Location: North by Northwest

Picture in Portrait Mode is Automatically Landscaped

Post by fsw »

Strangely enough pictures that have a bigger height than width are automatically rotated to landscape format.
Totally unusable.

When a picture is loaded with LoadImage it's rotated, when the same jpg picture is loaded with the WebGadget the orientation is preserved.

Automatic rotation of an image is bad.

I am to provide the public with beneficial shocks.
Alfred Hitshock
User avatar
kenmo
Addict
Addict
Posts: 1967
Joined: Tue Dec 23, 2003 3:54 am

Re: Picture in Portrait Mode is Automatically Landscaped

Post by kenmo »

I would 99% guess that the image file is actually landscape - probably from a phone or camera?

The WebGadget and other viewing software are probably auto-rotating it based on EXIF metadata.


Maybe there should be a flag request for LoadImage() to handle EXIF rotation data, but in the meantime somebody here can probably point you to some EXIF handling code.
User avatar
fsw
Addict
Addict
Posts: 1572
Joined: Tue Apr 29, 2003 9:18 pm
Location: North by Northwest

Re: Picture in Portrait Mode is Automatically Landscaped

Post by fsw »

@kenmo
Sorry for the late reply.

I think you are right it's a picture from a camera and the EXIF information is in there.
And EXIF has 8 modes of orientation :shock:
I'm sure LoadImage does not look into EXIF meta data...

Thank you for your hint.

ADMIN
Please move this to the "normal" macOS section.
(not bugs...)

I am to provide the public with beneficial shocks.
Alfred Hitshock
wilbert
PureBasic Expert
PureBasic Expert
Posts: 3870
Joined: Sun Aug 08, 2004 5:21 am
Location: Netherlands

Re: Picture in Portrait Mode is Automatically Landscaped

Post by wilbert »

It's indeed related to exif orientation.
You could use OSX API instead to load the image.
Windows (x64)
Raspberry Pi OS (Arm64)
Post Reply