Ticket #76 (closed defect: fixed)

Opened 3 years ago

Last modified 3 years ago

Thumbnails display rotated

Reported by: plogger@… Owned by: anti
Priority: normal Milestone:
Component: General Version: 1.0b2
Severity: normal Keywords:
Cc:

Description

My images that are in portrait format are displaying on the thumbnails page rotated 90 degrees. This is only the thumbnails.

Example: http://www2.land-pirate.net:8080/photos/index.php?level=album&id=1 see image DCP_1860.JPG

Change History

Changed 3 years ago by morydd

This could be related to ticket #27

Changed 3 years ago by anti

  • owner changed from mike to anti

I'm seeing this too in my galler, possibly a problem with phpThumb autorotate feature (ar=1).

Will look into it.

Changed 3 years ago by anti

  • status changed from new to closed
  • resolution set to fixed

Found it, the cause was in phpThumb.

If the photo contained a Exif thumbnail (and most photos from modern digital cameras do) and if the dimensions of that thumbnail (I think it's 160x120) were bigger than the requested dimensions of the thumbnail image (by default 100x100 in Plogger) then that embedded thumbnail was used as the source for the thumbnail.

So far, so good.

Then there is the Orientation tag in Exif information, most photo management software (I mean the ones that read the pictures from camera) can use it to autorotate the image. Which is just fine, except that the Exif thumbnail is left intact - it is not rotated. If the picture itself is - for example - a portrait, then even after auto-rotating the thumbnail is left as is - lying on it's side.

And in conditions described above, phpThumb used that thumbnail with the wrong orientation as source, which in turn caused this this bug.

Using the auto-rotate feature of phpThumb does not help, because the exif information has already been corrected and therefore it doesn not (and can not) do anything.

Workaround for now is to force phpThumb use the original image as the source for the thumbnail, this has been implemented in [197]

Reporter - if you can't use the latest code from SVN, then open your plog-functions.php in texteditor, locate generate_thumb function and add the following line

 $phpThumb->config_use_exif_thumbnail_for_speed = false;

right before the following block of text

// Set image height instead of width if not using square thumbs
if (!$config['square_thumbs']) {

this should be line 86.

Then you need to regenerate the thumbnails - either by simply deleting the contents of Plogger "thumbs" directory or alternatively by turning "use cropped square thumbnails" off, reloading your album in browser, then turning the option on again and reloading once more, this should take care of the problem.

Note: See TracTickets for help on using tickets.