Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

Add support for 'rotate' option #141

Closed
cmer opened this Issue Jan 4, 2013 · 7 comments

Comments

Projects
None yet
5 participants

cmer commented Jan 4, 2013

Possibly only supporting 90, 180 and 270 degrees.

Member

fabiomcosta commented Jan 6, 2013

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.

cmer commented Jan 7, 2013

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.

Contributor

JakeWharton commented Aug 21, 2013

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.

Owner

heynemann commented Aug 31, 2013

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 commented Jul 23, 2014

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

Owner

heynemann commented Jul 24, 2014

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

@heynemann heynemann closed this in e8a377a Jul 27, 2014

Owner

heynemann commented Jul 30, 2014

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

@Arthien Arthien pushed a commit to fanhero/thumbor that referenced this issue Aug 29, 2017

@guilhermebruzzi guilhermebruzzi + Guilherme Heynemann Bruzzi Adding support to rotate filter (fix #141) 1c726bf
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment