Announcement

  •  » Engine
  •  » [multisize] rotation

#1 2012-01-12 20:55:10

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

[multisize] rotation

From [Forum, post 126678 by rvelices in topic 18570] Multiple-size

rvelices wrote:

Concerning f (rotation / orientation) we have two ways:

1. Rotate the original image based on exif orientation - the admin will be able to rotate afterwards if he wants

Advantage: One easy step, no db change required, simpler code in piwigo core
Disadvantage: We loose metadata if only gd is available

2. Save the rotation angle in the db from Exif during sync/upload process. Let the admin eventually manually overwrite it. Perform computation of resulting derivative sizes and rotate the derivative based on this value.

Advantage: Originals are not touched
Disadvantage: Complicates a lot the piwigo core (during meta sync, ask if the admin chose a manual rotation angle?, crop/sizing algo more cumbersome, center of interest need also rotation etc ...)

Any feedback on point f?

How does Piwigo 2.3 works? The original is not modified, only the resized (websize+thumbnail) are rotated.

I think we should keep this behavior.

With Piwigo 2.3, if the photo needs a rotation (based on the Orientation EXIF tag) then Piwigo applies this rotation when creating the websize and Piwigo updates the Orientation EXIF tag. Then the thumbnail is created from the websize, no rotation is required.

Only the plugin [extension by Dsls] rotateImage can optionnaly rotate the original photo.

In my opinion, the new multiple size should not make more difficult the follow orientation when cropping option.

Offline

 

#2 2012-01-12 21:47:49

rvelices
Former Piwigo Team
2005-12-29
1960

Re: [multisize] rotation

plg wrote:

In my opinion, the new multiple size should not make more difficult the follow orientation when cropping option.

Yes but again we need to know in the "core" part that a rotation is required in order to compute the corect sizes ... And here it becomes difficult because we need to have an #images.rotation field

Offline

 

#3 2012-01-12 21:55:01

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

Re: [multisize] rotation

rvelices wrote:

plg wrote:

In my opinion, the new multiple size should not make more difficult the follow orientation when cropping option.

Yes but again we need to know in the "core" part that a rotation is required in order to compute the corect sizes ... And here it becomes difficult because we need to have an #images.rotation field

I think I have to read your post once again because I don't see why we have no problem with that in Piwigo 2.3 and it becomes a problem with multisize :-/

Offline

 

#4 2012-03-01 21:44:11

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

Re: [multisize] rotation

After discussion with rvelices, we have decided to add a new database column images.rotation:

* (from exif) 0 = no rotation
* (from exif) 1 = 90 clockwise
* (from exif) 2 = 180
* (from exif) 3 = 270 clockwise
* (manual) 4 = no rotation
* (manual) 5 = 90 clockwise
* (manual) 6 = 180
* (manual) 7 = 270 clockwise

+ ability to automatically rotate original if ImageMagick is available
+ user interface to set rotation (to set value to 4,5,6,7)

rvelices, does it mean that now we'll have to connect to the database in i.php to check if images.rotation?

Offline

 

#5 2012-03-02 06:17:04

rvelices
Former Piwigo Team
2005-12-29
1960

Re: [multisize] rotation

plg wrote:

rvelices, does it mean that now we'll have to connect to the database in i.php to check if images.rotation?

there is already a short db connection in i.php (1 single query to retrieve #images.coi width and height after which the db is closed)
so we just need to add the rotation retrieval ...

Offline

 

#6 2012-04-01 02:11:16

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

Re: [multisize] rotation

I have started to implement the automatic rotation with [Subversion] r13843 but there are still problems : if you generate XS first and then XXS, the photo is rotated twice. I suppose this is because XXS is generated from XS and the rotation angle is reapplied.

rvelices, please tell me what you think.

I don't think we have to manage the manual rotation right now, we can plan it in the code and have a plugin to manage it later.

Offline

 

#7 2012-04-02 08:55:25

rvelices
Former Piwigo Team
2005-12-29
1960

Re: [multisize] rotation

plg wrote:

rvelices, please tell me what you think.

I don't think we have to manage the manual rotation right now, we can plan it in the code and have a plugin to manage it later.

[Subversion] r13848
ok for manual rotation for later
however it think you forgot the mysql structure.sql ....

Offline

 

#8 2012-04-02 16:01:00

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

Re: [multisize] rotation

rvelices wrote:

however it think you forgot the mysql structure.sql ....

added in [Subversion] r13849, thank you for your code review.

Offline

 
  •  » Engine
  •  » [multisize] rotation

Board footer

Powered by FluxBB

github twitter newsletter Donate Piwigo.org © 2002-2024 · Contact