Ticket #27 (new enhancement)

Opened 3 years ago

Last modified 4 weeks ago

rotating images

Reported by: anti Owned by: mike
Priority: normal Milestone: 2.0
Component: General Version:
Severity: normal Keywords: needs-patch
Cc:

Description

Nothing fancy, just 90, 180 and 270 degrees.

Simple feature, but can be extremely useful at times

Change History

Changed 3 years ago by mike

  • version set to 1.0 Beta 2

This can be accomplished inside the upload dialogue with Windows XP already, do we really need this feature? phpThumb has an autorotate option that determines if the picture is a landscape or portrait and rotates accordingly. Maybe we could add an option to the options tab 'EXIF Auto Rotate?'

Changed 3 years ago by anti

I'd say it would be nice to have. Reasons

* Not all cameras add the rotation info to EXIF data * I have some pictures without EXIF information * Not everyone uses Windows XP

Of course this doesn't have to be in Beta2, doing it properly takes time and I'd say we should release something soon.

As for the option, autorotation is something we should just do automagically ;), let's pass the autorotate option to phpThumb and be done with it.

Changed 3 years ago by anti

We are going to have a problem with that - phpThumb uses PHP-s built in imagerotate() function for doing the actual rotation.

This is decribed at http://www.php.net/manual/en/function.imagerotate.php which also states the following Note: This function is only available if PHP is compiled with the bundled version of the GD library.

I did check it and my PHP (stock Debian package) is NOT compiled with the bundled version, an external one is used, and imagerotate() is not available on my system. This might be true for other Linux distros as well.

Changed 3 years ago by anti

  • version 1.0 Beta 2 deleted

Changed 3 years ago by Derek

Are we currently using EXIF to properly orient images? If so, why not just give the user the option to overwrite the existing rotation stamp on any image? Then we could use EXIF to orient images EVEN IF the initial jpeg didn't contain EXIF. It seems to me that between PHP and EXIFer, we should be able to implement that easily enough.

Though creating a UI where assigning which value is an intuitive process might be more of a challenge; users don't like "guess and test" methods. (ie. Allowing a dropdown where someone can select EXIF Rotation: 1 through 8, might be insufficient. Maybe taking CW 90, 180 and CCW 90 and translating them appropriately in the PHP -- to 8,3,6 -- would work well enough.)

Any caveats with this, or have I missed the boat on this ticket?

Changed 3 years ago by mike

We currently are not handling image rotations in any way, photos are uploaded as is.

I like the idea of having a drop-down, maybe on the upload pane of the interface, that contains "None, EXIF Auto Rotate, CW 90, 180, CCW 90". We would also have to find a way to integrate this into the bulk upload feature, probably having a dropdown for each row in the table (defaulted to NONE).

This is all fine and good, but will we have compatibility issues with image_rotate() as described in Anti's above comment? It's not worth risking losing a substantial amount of users due to software incompatibility for a feature that may be used by only a small portion of them.

If you look on the PHP man page for imagerotate() (http://us3.php.net/imagerotate) there are several functions in the comments, namely imagerotatebicubic() which do not use the imagerotate() function. The only downside to this is that the function calls used within this procedure require GD2.01+. I think most people have this, and Plogger would probably look pretty bad in GD1 anyway (I haven't seen it, but it doesn't have true color resampling so I'm sure the results are horrid).

Changed 3 years ago by anonymous

In my example (maybe not the best solution), I meant that images would always use the EXIF data if it existed, so the "EXIF Auto Rotate" option would be redundant. The dropdown would just overwrite the existing (or non-existing) orientation data.

I assumed we were talking about thumbnail generation; I don't think we should actually rotate the originals. If it still has the EXIF, it will figure things out on its own when it finds a new home. Also, if we rotate an image 180 and leave the EXIF data, won't folks who download the image wonder why it keeps unexpectedly flipping upside-down? (Because we flipped it at upload and then, reading the EXIF, their viewer flips it again? Or would we not retain the EXIF data on flipped images?)

Changed 2 years ago by derek

Why not just use imagerotate()? We can note in the docs that GD-bundled is needed. It certainly looks like a more straightforward approach than anything else, save for adding JPEGTRAN support.

Changed 7 weeks ago by sidtheduck

It looks like a user on the forums (jon) has a patch for phpthumb to rotate images that includes an alternate imagerotate() function. See discussion here -> http://plogger.org/forum/discussion/1242/image-rotation-after-upload/#Item_5

Changed 6 weeks ago by sidtheduck

  • keywords needs-patch added

Changed 4 weeks ago by sidtheduck

  • milestone set to 2.0
Note: See TracTickets for help on using tickets.