Auto Rotates using EXIF data

zalnn

Joined: 2008-04-28
Posts: 5
Posted: Tue, 2010-09-21 14:58

Hi guys,

I just did a fresh install of Gallery 2.3.1 and added a whole load of images. Moved a bunch of pictures around into albums and was all happy - when I realized that the auto-rotate using EXIF data was not enabled. So I enabled it and now when I add new pictures they are auto-rotated as expected - awesome!

My problem is there are ALOT of pictures that I added before turing on the feature that I would like to have auto rotated.

I tried using the 'Bulk Manage' plugin to rescan albums to no avail. How do I get Gallery to re-read the pictures, read the EXIF data and rotate the images?

Thanks,
Zalnn


Gallery version = 2.3.1 core 1.3.0.1
API = Core 7.54, Module 3.9, Theme 2.6, Embed 1.5
PHP version = 5.2.13 cgi-fcgi
Webserver = Apache
Database = mysqli 5.1.47-community-log, lock.system=flock
Toolkits = Exif, ImageMagick, Gd, jpegtran
Acceleration = none, none
Operating system = Linux hostXXX.hostmonster.com 2.6.28-10.44.intel.E1000E.BHsmp #1 SMP Sun Sep 19 20:11:53 MDT 2010 x86_64
Default theme = carbon
gettext = enabled
Locale = en_US
Browser = Mozilla/5.0 (X11; U; Linux i686 (x86_64); en-US; rv:1.9.2.7) Gecko/20100721 CentOS/3.6-3.el5.centos Firefox/3.6.7
Rows in GalleryAccessMap table = 4
Rows in GalleryAccessSubscriberMap table = 5619
Rows in GalleryUser table = 2
Rows in GalleryItem table = 5619
Rows in GalleryAlbumItem table = 221
Rows in GalleryCacheMap table = 0

 
nivekiam
nivekiam's picture

Joined: 2002-12-10
Posts: 16504
Posted: Tue, 2010-09-21 15:31

First a helpful suggestion. If ImageMagick is working, uninstall GD

For the EXIF data, while it's not stored in the DB and read every time the images are loaded (so keep that in mind if things start slowing down as the site gets busier) the auto-rotate functionality is only checked once, upon the initial import. To get those to auto-rotate, you'll need to re-upload them. With the number of images in your Gallery and it being new it's probably going to be a lot easier to delete them and re-upload the images.

I believe the re-scanning feature of the bulk upload module, even if it does read from the EXIF data is only looking at date/time stamps.
____________________________________________
Like Gallery? Like the support? Donate now!!! See G2 live here

 
suprsidr
suprsidr's picture

Joined: 2005-04-17
Posts: 8339
Posted: Tue, 2010-09-21 15:35

Its far better to rotate before upload as your resizes don't get rotated unless the original is pre-rotated.

-s
FlashYourWeb and Your Gallery with The E2 XML Media Player for Gallery2

 
nivekiam
nivekiam's picture

Joined: 2002-12-10
Posts: 16504
Posted: Tue, 2010-09-21 15:55

Agreed, I much prefer to rotate and even resize before uploading. The only time I don't resize is if I want to make the original, raw image available for download. Makes uploads faster and uses less resources on the server (helping get the images on the web faster :) )
____________________________________________
Like Gallery? Like the support? Donate now!!! See G2 live here

 
zalnn

Joined: 2008-04-28
Posts: 5
Posted: Tue, 2010-09-21 16:18

Wow! That was fast!

So the consensus is that there is no way to rescan the pictures and have them auto rotate?

 
zalnn

Joined: 2008-04-28
Posts: 5
Posted: Tue, 2010-09-21 16:21

I removed GD as ImageMagick works fine. That said does Gallery automatically use jpegtrans for all rotations and crops over ImageMagick?

Gallery version = 2.3.1 core 1.3.0.1
API = Core 7.54, Module 3.9, Theme 2.6, Embed 1.5
PHP version = 5.2.13 cgi-fcgi
Webserver = Apache
Database = mysqli 5.1.47-community-log, lock.system=flock
Toolkits = Exif, ImageMagick, jpegtran
Acceleration = none, none
Operating system = Linux hostXXX.hostmonster.com 2.6.28-10.44.intel.E1000E.BHsmp #1 SMP Sun Sep 19 20:11:53 MDT 2010 x86_64
Default theme = carbon
gettext = enabled
Locale = en_US
Browser = Mozilla/5.0 (X11; U; Linux i686 (x86_64); en-US; rv:1.9.2.7) Gecko/20100721 CentOS/3.6-3.el5.centos Firefox/3.6.7
Rows in GalleryAccessMap table = 4
Rows in GalleryAccessSubscriberMap table = 5615
Rows in GalleryUser table = 2
Rows in GalleryItem table = 5615
Rows in GalleryAlbumItem table = 220
Rows in GalleryCacheMap table = 0

 
nivekiam
nivekiam's picture

Joined: 2002-12-10
Posts: 16504
Posted: Tue, 2010-09-21 17:46

The jpegtran plugin doesn't work by itself it needs something like ImageMagick to work with. So when ImageMagick performs an editing function like rotation, cropping, etc, jpegtran is used to process the jpeg losslessly (is that a word?)
____________________________________________
Like Gallery? Like the support? Donate now!!! See G2 live here

 
zalnn

Joined: 2008-04-28
Posts: 5
Posted: Tue, 2010-09-21 19:38

Awesome! Thanks.

My hosting company's (hostmonster) jpegtran was version 6b and was failing the crop test with an exit code of 1. So I downloaded the binary, put it in my home folder, pointed Gallery at the new location, and both tests passed.

Is this in keeping with best practices? jpegtran should still be used right?

 
nivekiam
nivekiam's picture

Joined: 2002-12-10
Posts: 16504
Posted: Tue, 2010-09-21 19:42

jpegtran is a personal choice, most people probably won't notice a difference with or without it.
____________________________________________
Like Gallery? Like the support? Donate now!!! See G2 live here