owntracks / android

OwnTracks Android App
http://owntracks.org
Eclipse Public License 1.0
1.37k stars 477 forks source link

Card image rotated 90 degrees #1832

Closed Enterprise76 closed 1 month ago

Enterprise76 commented 1 month ago

I just started exploring Cards and Friends on Ownstracks. When I publish a card with an image to the MQTT broker (as described [here](https://owntracks.org/booklet/features/card/ ) my android app displays the image rotated 90 degrees. The Owntracks frontend and recorder map both show the images correctly. Any ideas? Thanks!

jpmens commented 1 month ago

Forgive the possibly stupid question, but does the image flip to its supposedly normal orientation when you change the phone's orientation?

Would it be possible for you to produce an image which has that behavior and send it to us at support@owntracks.org so we can investigate ?

Enterprise76 commented 1 month ago

Good idea, but device rotation does not affect the image. I'm troubleshooting different things right now. It only appears to happen when I use a picture of my face (which I am not going to share!). For testing, I used a clipart image of an arrow to highlight the image rotation, but the arrow does not seem to get rotated!

I'll keep trying different images and see if I can narrow down when things get rotated. Hopefully I can get a screen shot to share.

I did notice that the image appears rotated on both IOS devices and android devices... so this is not android specific like I first thought. The recorder website shows the images correctly.

Thanks!

jpmens commented 1 month ago

We don't need to see your face. A photo of a vertical line with an arrowhead on it drawn on a sheet of paper would suffice. :-)

Taken like you take the other photo.

Enterprise76 commented 1 month ago

I have tried multiple other photos like you suggested. I have drawn an arrow and taken a picture of it, I have used clipart arrows, and I have even used other face images. Every time, they appear correctly in the owntracks apps (IOS, Androind, and the recorder map). It is only one certain picture of me that appears rotated. When I open the original image in an editor, it is in the correct orientation. All I can guess is that for some reason ImageMagik is rotating this particular image, but not others. I am simply unable to reproduce the error except for that one image.

ckrey commented 1 month ago

Probably it‘s AI 🤷🏻‍♂️

growse commented 1 month ago

Is it a png?

jpmens commented 1 month ago

Have you tried converting your image with the convert -auto-orient option? By rights that should use and I think reset the EXIF data which might be causing orientation to change.

Enterprise76 commented 1 month ago

Bingo! That fixed it. I ran the image that was rotated 90 degrees through ImageMagick's convert -auto-orient and the image now appears correct on every device.

For some reason it was just that one image. It must have been the way my phone added data to the image.

Thank you for the help and advice!

Mike

jpmens commented 1 month ago

That data is called EXIF and all digital cameras add it to photos. What probably happened, is when you took that one picture, your phone thought 'landscape' where it was actually 'portrait' (or vice versa), and ImageMagik then converted it accordingly. (For the other tests you did the camera was correctly positioned and it recorded EXIF appropriately.)