#Jpeg lozding don't work as expected

17 messages · Page 1 of 1 (latest)

toxic cove
#

ok, new problem with this jpg journey.

i have 2 images, one landscape and one portrait, but LoadImage return me width = 4000 and height = 3000 for both of them, and don't care about the image orientation. (for the portrait one i am supposed to get width = 3000 instead of width = 4000, same for the height)

this appens only on jpg images, because if i'm loading the sames images, but converted to png, the orientation is the right one.

@pallid lagoon if you have any hints on that

i guess this is why jpg is not supported by default in raylib, but it seems too simple to be just not supported because of that (to simple but not for me hehe)

also, the image loaded into raylib is darker than the original image; idk why

#

yeah I did a new subject because i think it deserve it, sorry for mentioning twice

azure bronze
#

Can you share the images?

toxic cove
#

for example, an image en landscape and another one in portrait

#

the second one is in portrait, but when I load it in raylib she's detected in landscape, with width and height reversed

olive bramble
#

did you enable jpeg support in raylib? it is off by default

toxic cove
#

yep i enable it
if disable, raylib will output a message and show nothing, but in my case the image is shown, its just dimensions metadata are reversed

olive bramble
#

it's all using stb image, a third party image reading library

#

jpeg is not supported by default because for games PNG is better in every way.

#

have you tried opening the images in paint and resaving them?

toxic cove
#

yeah but in my case, my application (it's not a game) must be able to open every common image format lmao (png, jpg at least)

nope, but if I open the image in GIMP, i have a warning popup that say : "this image contains EXIF metadata for rotation", and I pretty sure that raylib (only for jpeg i guess) does not take care of EXIF metadata

olive bramble
#

ahhh yeah I agree, I don't think stb image reads that data.

toxic cove
#

okkk so maybe I need to read it manually (idk how but internet may know), and edit my Image structure's datas ?

olive bramble
#

you may want to check out stbimage to see if there is an updated version you you swap too

#

it's a single header library that reads a lot of image formats, raylib uses it to read all the common ones.

toxic cove
#

okkk, i guess it's my mission for tomorrow! ty, will let you know if i'm struggling