-
Notifications
You must be signed in to change notification settings - Fork 8
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
Android phones do not give TiffTag for rotation #99
Comments
2024-05-12 21:33:05.605 10872-10872 rotateImage com.sar.app.android D Orientation: null from
|
Hi, thanks for reaching out. So you have different results for the same file on different platforms? Can you share a sample file for further investigation? I like to inspect it using https://stefan-oltmann.de/exif-viewer which has a useful HEX view and is also powered by this library. Kind regards, Stefan |
Hi Stefan! No, it is when I take a picture with the phones/tablets. I used Exif data to get rotation in Compose a year ago, and that worked fine, we could rotate the image so it always was the right way up. This time, we are using Compose Multiplatform, so Android Graphics do not work, and ExifInterface also gives me orientation 0 on the android side of things when I made an expect/actual function with Kim on iOS and ExifInterface on Android. In other words, I am confused, as I did get the orientation out from my phone last year, I wonder if something is lost in translation from jpg to inputstream, or if there is something else going on that I don't quite understand. |
Yes, it’s possible that grabbing a picture from camera input just gives you JPEG bytes without any metadata. I believe it is the camera app itself that adds the EXIf to the file. So you would need to detect the phone rotation when grabbing the image bytes and write that value as the orientation tag. You can check this if you save the bytes you got from taking the picture to a file and get that off your phone using If metadata is present and Kim can’t read it this is a bug I need to fix. If it’s not there (what I think is highly likely) the output you got is correct. As you say you got the orientation out last year, do you mean a older version of this library works and something broke in the current version? |
@JakkeJ Did you figure out the source of the problem? |
I actually used some old code from an old mobile programming course project to load the pictures in, either newly taken or from gallery, and when I did that I got the exif data no problem. Since it worked fine on iOS pictures that sorted me out. |
@JakkeJ You said also ExifInterface did not work for you. Can you share the code that works for you and gets the orientation right? |
Sorry, I'm in the middle of moving right now so I don't have access to my computers for a while. So I'll try to explain: Not entirely sure it was on your end tbf, the way the code to take pictures I used before, created an empty png file I believe, and then added the data to it, most likely this didn't include the exif data which was never added, seemingly. My old code from last year just did this process differently, and exif data was included. As said earlier it was only on Android it happened, and I followed some guide, probably from Medium, on how to take pictures in Kotlin Multiplatform. |
@JakkeJ Do you need any further help here or is this issue resolved? |
I think I found a solution for it, but its a while ago now, it was for our
bachelor's thesis
Mvh.
Jim Tore Oshaug Jakobsen
…On Sun, 22 Dec 2024, 10:12 Stefan Oltmann, ***@***.***> wrote:
@JakkeJ <https://github.com/JakkeJ> Do you need any further help here or
is this issue resolved?
—
Reply to this email directly, view it on GitHub
<#99 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAKJWY7F3JMPT6BCV2NOM2L2GZ66HAVCNFSM6AAAAABJTECNGWVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDKNJYGM4DOMJSGI>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
I have rotated pictures in regular Compose/Kotlin before, and gotten the Exif orientation value out, but there is nothing here, so this is pretty useless for rotating pictures the right way up. This happens on using webcamera on emulator as well as a real Sony Xperia 1V device. On iPad I get orientation 1 out, so that works, but I am depending on getting it out on all devices...
Any tips are welcome.
The text was updated successfully, but these errors were encountered: