Modify

Opened 4 years ago

Closed 4 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)

20150110_140123.jpg (2.3 MB) - added by holgermappt 4 years ago.
Photo with EXIF orientation 6, Rotate 90 CW

Change History (9)

comment:1 Changed 4 years ago by bastiK

Do you have a geotagged image with changed orientation that we can include for testing?

comment:2 Changed 4 years ago by bastiK

Resolution: fixed
Status: newclosed

In 7956/josm:

fixed #10962 - Photo orientation should not be ignored for thumbnails

Changed 4 years ago by holgermappt

Attachment: 20150110_140123.jpg added

Photo with EXIF orientation 6, Rotate 90 CW

comment:3 Changed 4 years ago by holgermappt

Cool, looks great. I added a photo which needs to be rotated 90 degrees clockwise.

comment:4 Changed 4 years ago by bastiK

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:5 Changed 4 years ago by bastiK

In 7957/josm:

see #10962 - add sample photos

comment:6 Changed 4 years ago by Don-vip

Milestone: 15.01

comment:7 Changed 4 years ago by Don-vip

Resolution: fixed
Status: closedreopened

comment:8 Changed 4 years ago by bastiK

Resolution: fixed
Status: reopenedclosed

In 7959/josm:

closes #10962 - fix tests

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain team.
as The resolution will be set.
The resolution will be deleted.

Add Comment


E-mail address and name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.