geohashdroid icon indicating copy to clipboard operation
geohashdroid copied to clipboard

Posting a pricture taken in portrait mode rotates it 90 degrees anti-clockwize

Open Aggaar opened this issue 4 months ago • 3 comments

How to recrate: With any date selected, clicking the Wiki tab, cheking "Post a picture" and selecting a picture taken in portrait mode will select the correct photo, but display (and also post if clicking "submit") the photo rotated 90 degrees.

Example

The problem doesn’t occur if i crop the photo beforehand, even if this crop makes the image "taller", or is just a "crop in" (retaining the aspect ratio)

Example 2

Info:

  • App version: 0.9.6.7
  • Android: 13
  • Camera app: Stock Samsung camera app (13.1.01.10) taking .jpg's

Aggaar avatar Aug 07 '25 12:08 Aggaar

Possible dup of #9?

timparenti avatar Aug 07 '25 15:08 timparenti

Oh, wow, #9 is an old one. I'm surprised I actually haven't done anything about it. Whoops.

If memory serves, last time I looked at this, the issue boiled down to the device using JPEG metadata to mark an image as "rotated" or not (in 90° intervals), which is perfectly valid. Except, the code I'm using to edit the image (shrink it down to save space and attach the infobox) tosses that metadata, resulting in everything being applied to the original image, unrotated. In fact, that might explain why cropping the image on the phone itself "fixes" it, as that might be applying the metadata and removing it from the newly-created copy.

My first instinct is to just go over the code and make sure I'm preserving that metadata (and/or just rotate it to match prior to tossing it out and editing). However, another part of me remembers the times my phone didn't get the rotation right in normal photo use when it initially saved the image (mostly in cases where I'm taking a picture straight down on a table or the ground), which sounds like a better solution would be to add manual rotate buttons in the posting interface, just to be sure. The initially displayed image would read in the metadata, but there'd be buttons to override it before submitting.

What do you think?

Incidentally, since #9 was just an import from the old Google Code site from... yikes, 15 years ago, and there wasn't any discussion over there, I'm okay with making this the "main" issue for it.

CaptainSpam avatar Aug 08 '25 23:08 CaptainSpam

Well, as far as I can tell, the code itself should be good: I can load images, they look properly rotated according to EXIF data, I have an interface that allows the user to apply 90° rotations and mirror operations at will, and all of that should be applied to the image data upon upload.

But... that's now held up because the actual upload code stopped working for some reason, and I can't for the life of me figure out why. The wiki (both the real Geohashing Wiki and my private testing one) are both giving me major issues, and I'm not going to make a new release unless I can actually make sure this works. This might take some time.

CaptainSpam avatar Sep 02 '25 06:09 CaptainSpam