Modify

Opened 9 years ago

Closed 9 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 9 years ago.
Photo with EXIF orientation 6, Rotate 90 CW

Change History (9)

comment:1 by bastiK, 9 years ago

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

comment:2 by bastiK, 9 years ago

Resolution: fixed
Status: newclosed

In 7956/josm:

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

by holgermappt, 9 years ago

Attachment: 20150110_140123.jpg added

Photo with EXIF orientation 6, Rotate 90 CW

comment:3 by holgermappt, 9 years ago

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

comment:4 by bastiK, 9 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:5 by bastiK, 9 years ago

In 7957/josm:

see #10962 - add sample photos

comment:6 by Don-vip, 9 years ago

Milestone: 15.01

comment:7 by Don-vip, 9 years ago

Resolution: fixed
Status: closedreopened

comment:8 by bastiK, 9 years ago

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. Next status will be 'reopened'.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.