Forum: Ruby on Rails image rotation? (orientation)

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
2c3e9116fabc3e9f09927d1ffa8bf9e3?d=identicon&s=25 Ryan Scudellari (Guest)
on 2006-06-19 05:54
(Received via mailing list)
Hi there,
So, I have this photo site.  When the users upload photos, they are
generally in a zip file.  So the site unzips the photos and then
generates 5 versions of each one:  small_thumb, large_thumb, small,
medium, and large.  After it finishes that, it will forward the user
onto a page where they can edit the pictures' title, caption and
orientation (20 pictures per page).  This page uses Ajax so when you
select a photo to edit, it simply gives you the tools right within
that photo's own div.  This means each photo has it's own save button.
 Once you save, that div refreshes with the updated values (including
the new orientation of the image).

I haven't implemented the orientation part yet, but I'm running into a
problem in my head:

Ideally I want a rotate right image and a rotate left image.  When the
user clicks them I will simply rotate the image with javascript and
keep track of the clicks, all on the client-side.  Then when they
save, it will process the orientation change and rotate all 6 versions
of the image (original, two thumbs, 3 smaller versions).  I think that
will be fast than just rotating the original and regenerating the
other 5.  Anyway:  how do you rotate an image with javascript?  I've
searched for "javascript rotate image" and "javascript image
orientation" on google, but it's not turning up much of anything.  I
don't see anything built-in to the visual_effect part of RoR either.
Any suggestions?  I want this to be as cross-browser as possible.

If anyone has a better solution to my situation, I'm up for suggestions.

Thanks, Ryan
This topic is locked and can not be replied to.