Announcement

#1 2011-06-11 06:16:11

norbusan
Member
Nonoichi, Ishikawa, Japan
2011-06-11
60

[resolved] Automatic rotation of jpgs not working

Hi everyone,

background data: piwigo 2.2.2
activated automatic rotation in local/config/config.inc.php with $conf['upload_form_automatic_rotation'] = true;
verfiied that there is imagemagick installed (dpkg -l lists it, and "convert" works)

I cannot get automatic rotation working. I have tried uploading direct from the web site as well as the shotwell/piwigo connector (shotwell from latest git sources) and in all cases the photo ends up in the unturned orientation, although all of nautilus, shotwell, gthumb etc correctly see the exif orientation and display the image rotated.

Any suggestions?

Thanks

Norbert

Offline

 

#2 2011-06-11 08:10:28

Gotcha
Piwigo Team
Pourrières (83) [FR]
2007-03-14
604

Re: [resolved] Automatic rotation of jpgs not working

Hi Norbert,

([Bugtracker, ticket 2335, not a bug] image rotation based on exif tags does not work)

Have you tried to add photos directly via the Administration Console in your gallery?
He must know where the problem originates.

Offline

 

#3 2011-06-11 08:12:12

norbusan
Member
Nonoichi, Ishikawa, Japan
2011-06-11
60

Re: [resolved] Automatic rotation of jpgs not working

Yes, I tried both uploading via the admin console as well as via shotwell, both without success.

Offline

 

#4 2011-06-11 20:34:56

plg
Piwigo Team
Nantes, France, Europe
2002-04-05
13182

Re: [resolved] Automatic rotation of jpgs not working

Hi norbusan/norbert,

1) to make sure ImageMagick is used on your Piwigo, open screen [Administration > Photos > Add > Configuration], do you have a section to manage high definition resize settings? If yes: you're using ImageMagick, if no: you're using GD.

By the way, the automatic rotation does not depend on ImageMagick. You can also have rotation with GD. It depends from other prerequisites.

2) can you give a link on a photo that is not rotated by Piwigo?


Latest blog post (November 9th 2018) Why Flickr could not remain free for ever

Offline

 

#5 2011-06-13 02:16:24

norbusan
Member
Nonoichi, Ishikawa, Japan
2011-06-11
60

Re: [resolved] Automatic rotation of jpgs not working

Hi plg,

thanks for the answer. Here some answers:
1) under Administration > Photos > Add > Settings (I assume that is what you meant, not Configuration?) I only have two blocks, one named "Web size photo" and the other "Thumbnail"

so rotation is not depending on imagemagick, good.

I tested with a few more images and found out that it does work indeed sometimes, and sometimes it does not. So the photos from my iPhone are shown correctly in shotwell/nautilus, but not rotated in piwigo, while the photos from my camera are correctly rotated.

Here is a photo that does not rotate well in piwigo:
http://www.logic.at/people/preining/IMG_0667.JPG

Hope that helps to track down why it isn't rotated.

Thanks and all the best

Norbert

Offline

 

#6 2011-06-14 14:44:06

plg
Piwigo Team
Nantes, France, Europe
2002-04-05
13182

Re: [resolved] Automatic rotation of jpgs not working

I've tested with your bicycle photo and rotation is perfect either with GD or Imagick (the ImageMagick binding for PHP).

My feeling is that you don't have the imagerotate function available. Please check it :

1) activate plugin LocalFiles Editor on screen [Administration > Plugins > Manage]
2) go to [Administration > Plugins > LocalFiles Editor], tab "Local config" and paste the following code:

Code:

if (function_exists('imagerotate'))
{
  file_put_contents('/tmp/piwigo.log', "OK : function imagerotate exists\n", FILE_APPEND);
}
else
{
  file_put_contents('/tmp/piwigo.log', "K0 : function imagerotate does not exist\n", FILE_APPEND);
}

3) Click on the "Save file" button
4) Go to Administration Home
5) open file /tmp/piwigo.log and tell us what's the message

If my feeling is correct, then maybe ImageMagick can save you :-) :

1) sudo apt-get install php5-imagick
2) sudo /etc/init.d/apache2 restart
3) do the test once again (is there a "High Definition" section on [Administration > Photos > Add > Settings] ?)


Latest blog post (November 9th 2018) Why Flickr could not remain free for ever

Offline

 

#7 2011-06-15 04:29:26

norbusan
Member
Nonoichi, Ishikawa, Japan
2011-06-11
60

Re: [resolved] Automatic rotation of jpgs not working

Hi plg,

thanks for tracking that down.

First test: piwigo.log contains the KO string, no imagerotate function (should that be provided by the gd module?)

Second test: installing php5-imagick, now a HD part is in the Admin > Photo > Add > Settings and uploaded photos are rotated.

Thanks a lot.

BUT: Why some photos have been rotated and some photos have not been rotated I don't understand ;-)

All the best

Norbert

Offline

 

#8 2011-06-15 10:00:21

sbyke
Member
2011-02-26
13

Re: [resolved] Automatic rotation of jpgs not working

I've been following along.  I found that ubuntu hardy and a few other versions have a bug with php5-imagick that results in the following error:
PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/lib/php5/20060613/imagick.so' - /usr/lib/php5/20060613/imagick.so: cannot open shared object file: No such file or directory in Unknown on line 0

I fixed that.  I then uploaded a few photos with piwigo -> admin -> photos -> add.  They correctly autorotated.

When using digikam's built in upload -> piwigo they did not auto-rotate, even though they display correctly in digikam.  I tried adding via the localfiles editor:
$conf['upload_form_automatic_rotation'] = true;

That did not fix the problem with digikam uploads.

Does that effect programs that directly use <piwigo_home>/ws.php?  Is there a different variable I should set?

Does it look like it's a bug with Digikam?

Is it possible that the poster is uploading using more than one method and only one method is broken?

Offline

 

#9 2011-06-15 10:28:20

plg
Piwigo Team
Nantes, France, Europe
2002-04-05
13182

Re: [resolved] Automatic rotation of jpgs not working

norbusan wrote:

BUT: Why some photos have been rotated and some photos have not been rotated I don't understand ;-)

Because the photos have been rotated before being sent to Piwigo. I don't see any other reason.


Latest blog post (November 9th 2018) Why Flickr could not remain free for ever

Offline

 

#10 2011-06-15 10:29:43

plg
Piwigo Team
Nantes, France, Europe
2002-04-05
13182

Re: [resolved] Automatic rotation of jpgs not working

sbyke, please use another thread, your problem is a bit different and would like to mark this topic as resolved :-)


Latest blog post (November 9th 2018) Why Flickr could not remain free for ever

Offline

 

#11 2011-06-15 10:30:44

plg
Piwigo Team
Nantes, France, Europe
2002-04-05
13182

Re: [resolved] Automatic rotation of jpgs not working


Latest blog post (November 9th 2018) Why Flickr could not remain free for ever

Offline

 

Board footer

Powered by FluxBB

github twitter facebook google+ newsletter Donate Piwigo.org © 2002-2019 · Contact