Opened 10 years ago
Closed 10 years ago
#10962 closed defect (fixed)
Photo orientation should not be ignored for thumbnails
Reported by: | holgermappt | Owned by: | team |
---|---|---|---|
Priority: | minor | Milestone: | 15.01 |
Component: | Core image mapping | Version: | |
Keywords: | Cc: |
Description
The ImageDisplay
class has code to rotate a photo if the orientation (ImageEntry.exifOrientation
) is set accordingly. But the thumbnail loader (ThumbsLoader
) ignores the orientation. I would like to see thumbnails in the right orientation.
I looked into this, but I don't understand all details. I think there should be one function that loads images including rotation and scaling. Or just rotation and scaling. Then that function is used in the image display and the thumbnail loader. ImageEntry
seems to be a good place to add such a function (it knows the path and the orientation). But ThumbsLoader
does g.drawImage()
in a while
loop while ImageDisplay
calls it without loop. I'm not sure if there is a reason for the difference. The tracker handling is slightly different too.
Another issue is cached thumbnails that have a wrong orientation. Cached thumbnails are taken as-is and would not benefit from the new load function. Maybe this is acceptable.
Attachments (1)
Change History (9)
comment:1 by , 10 years ago
by , 10 years ago
Attachment: | 20150110_140123.jpg added |
---|
Photo with EXIF orientation 6, Rotate 90 CW
comment:3 by , 10 years ago
Cool, looks great. I added a photo which needs to be rotated 90 degrees clockwise.
comment:4 by , 10 years ago
Thanks for the image!
Apparently, the while loop in ThumbsLoader
ensures, that the drawing has finished, before it is written to disk. However, I'm not sure if it is really a good idea to call drawImage
over and over again. ImageObserver
or MediaTracker
is intended for this. When I add a debug output in the loop, drawImage
always returns true on first call. So I guess it does no harm at least.
About the wrong thumbnails in the cache, that won't get updated: You are the first who noticed this problem, which existed for a long time, so I wouldn't worry about it.
comment:6 by , 10 years ago
Milestone: | → 15.01 |
---|
comment:7 by , 10 years ago
Resolution: | fixed |
---|---|
Status: | closed → reopened |
unit tests must be updated, see http://donvip.fr/jenkins/job/JOSM/1770/testReport/
Do you have a geotagged image with changed orientation that we can include for testing?