Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Add support for 'rotate' option #141

Closed
cmer opened this Issue · 7 comments

5 participants

Carl Mercier Fabio M. Costa Jake Wharton Bernardo Heynemann nopiece
Carl Mercier

Possibly only supporting 90, 180 and 270 degrees.

Fabio M. Costa
Collaborator

It's possible to flip the image pixels, which is not exactly a rotation, but could solve your case:

-Ex-F means resize the image to be ExF of width per height size. The minus signs mean flip horizontally and vertically;

So if you do http://my-server.thumbor.org/unsafe/-300x-200/image.jpg it will flip image pixels on the x and y axis, which is what rotate 180 does.

But yeah, besides that, 90 and 270 degrees are not supported right now.

Carl Mercier

I really meant a good ol' rotation. The reason for this is that we let our users upload pictures and sometimes, they're sideways or upside down. We have a button to let them rotate them on the screen (javascript + css) and when they submit the form, we store the rotation. We need a way to be able to display their pictures properly rotated later.

Right now we use Carrierwave but I'd like to move towards generating images on the fly and was considering Thumbor.

Jake Wharton

I like the 90 degree increment option. When you move into any degree then you have to take into account whether you expand the bounding box of the image or clip.

Bernardo Heynemann
Owner

The problem with this is that we'd have to take into account that rotating has to come before anything is done with the image.
Thumbor has a "contract" with the users that if you ask it for a 300x200 image, you'll get a 300x200 image.
If rotating is done after cropping and resizing, we'd return a 200x300 image, which is not what the user expected.

Other than that this is really simple to implement. Anyone want to tackle it? The main issue here is actually implementing the sintax in the libs (libthumbor, rubythumbor, phumbor, polexor, etc).

nopiece

I'd also love to see a rotate option (90 degree increments). I created a bounty for this feature over on Bountysource. Hopefully some others who also want this feature will add to the bounty!

https://www.bountysource.com/issues/3270137-add-support-for-rotate-option

Bernardo Heynemann
Owner

This can be easily implemented as a filter: rotate(90). Then no changes to the libs need to be done.

Bernardo Heynemann heynemann closed this in e8a377a
Bernardo Heynemann
Owner

Just to let everyone know, this is live in Release 4.3.0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.