Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

High format images are read as landscape images #1

Open
expectopatronum opened this issue Apr 30, 2016 · 0 comments
Open

High format images are read as landscape images #1

expectopatronum opened this issue Apr 30, 2016 · 0 comments

Comments

@expectopatronum
Copy link

expectopatronum commented Apr 30, 2016

I have two cat images, one in high format and one in landscape format (https://www.dropbox.com/sh/7xa9jfxlsr6wy5s/AABVZJO0GrwvuVb9qryJjCG7a?dl=0). When I read them with readJPEG the dimensions for both are the same:

jpg1 <- readJPEG("/Volumes/Vero/Data/Animals/Cat/20150805_172829743_iOS.jpg")
jpg2 <- readJPEG("/Volumes/Vero/Data/Animals/Cat/20150808_183100413_iOS.jpg")
str(jpg1)
str(jpg2)

The last two lines both print num [1:2448, 1:3264, 1:3] 0.996 0.996 0.996 0.996 0.996 ... although the first (high format) should be [1:3264 1:2448 1:3]. When I save them again with writeJPEG the landscape one looks normal (although its larger than before) and the other one is mixed up (it's rather large so I don't upload it except you would like me to).

After using jpg1_a <- aperm(jpg1, c(2, 1, 3)) and writing the image it looks normal but rotated.

Is there something wrong with the library or is it a problem with my image? (I have encountered that some other programs also have problems with photos taken by an iPhone).

Best regards,
Verena

EDIT: I looked a little further and found out that the rotation would be in the exif data (1 for "normal" and 6 for "rotated"), e.g. explained here. [http://www.daveperrett.com/articles/2012/07/28/exif-orientation-handling-is-a-ghetto/](EXIF orientation handling is a ghetto). I'm trying to figure out a way based on the [https://github.com/ironholds/exif](exif meta data) to handle my images correctly. I don't know if you will/want to include this information in your package.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant