EXIF rotation ignored when using "Add from server"
jstricker
Joined: 2009-05-07
Posts: 8 |
Posted: Thu, 2009-05-07 04:21 |
All of my images appear in landscape mode, rather than a mix of portrait and landscape. I'm not sure if this also happens when clicking "Add a photo" because I'm running into the problem described at http://gallery.menalto.com/node/87507. If it's remotely helpful, I'm using gallery3 alpha4 on Linux with PHP 5.2.4 and MySQL 5.0.67. The graphic toolkit configured on the site (by default) is ImageMagick. |
|
Posts: 27300
please post a image that is original not rotated with the rotation info in the EXIF.
Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team
Posts: 8
Here's the original image, taken straight from the memory card: http://jeffstricker.com/g3_exif_rotation_example/IMG_0097.JPG (caution: 5.8MB image)
Here's the image from the resizes folder, as generated by G3: http://jeffstricker.com/g3_exif_rotation_example/resizes_IMG_0097.JPG
Here's the image form the thumbs folder, as generated by G3: http://jeffstricker.com/g3_exif_rotation_example/thumbs_IMG_0097.JPG
As you can see, G3 is maintaining the EXIF information but not actually applying it when generating the resized image and thumbnail image.
I suppose this is an assumption in terms of functionality on my part, but I would generally expect it to:
1. Read the EXIF information from the image and save it to the database (the rotation value in this case is either 6 or 8)
2. Leave the original image untouched in var/albums/{album_name}
3. Apply the rotation to the in-memory image, change the EXIF rotation value (to 1, or no rotation), resize, and save in var/resizes/{album_name}
4. Resize to the thumbnail size and save the image a second time to var/thumbs/{album_name}
Posts: 7994
That's not implemented yet. But I've created a ticket for it:
http://apps.sourceforge.net/trac/gallery/ticket/265
Posts: 8
For anyone else who wants to achieve this before it's implemented in Gallery3, I posted some code on the ticket that Bharat linked above.
Posts: 40
I wrote an other solution based on jhead :
- install jhead (available in Debian and RedHat/CentOS with EPEL)
- install my module for G3 [1]
It does a lossless rotation of the image and update the EXIF informations. Finally, it updates the item with new height and width.
[1] http://web.ledisez.net/jhead_v1.tar
Posts: 27300
ondex, please create a fork of your changes:
http://codex.gallery2.org/Gallery:Using_Git#Creating_the_fork
Then it can be added to the community repo.
Also a codex page would be helpfull as well. Thanks for the contribution!
Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team
Posts: 573
I added that code to my RC2 install, and it doesn't seem to work...perhaps too many things have changed since you initially posted this. Are you able to update it for RC2?
--
For PHPNuke, phpBB2, and phpBB3 integration help, please visit NukedGallery.net.
[img]http://www.nukedgallery.net/signature.jpg[/img]
Posts: 573
https://sourceforge.net/apps/trac/gallery/ticket/265 has been closed. The autorotate module is now available from git. See http://codex.gallery2.org/Gallery3:Modules:autorotate .
--
For PHPNuke, phpBB2, and phpBB3 integration help, please visit NukedGallery.net.
[img]http://www.nukedgallery.net/signature.jpg[/img]