Posted almost 7 years ago. Visible to the public.

Carrierwave: Auto-rotate tagged JPEGs

Modern cameras often produce JPEGs that have a "I should be rotated 90° to the left" flag. If you process such pictures using Carrierwave this will be ignored and you'll end up with a wrongly rotated image.

Fortunately, this is easy to fix:

In your Uploader, add

Copy
process :auto_orient # this should go before all other "process" steps def auto_orient manipulate! do |image| image.tap(&:auto_orient) end end

Note: You can add the process :auto_orient outside of all your version blocks and it will apply to all of them.

makandra has been working exclusively with Ruby on Rails since 2007. Our laser focus on a single technology has made us a leader in this space.

Owner of this card:

Avatar
Tobias Kraze
Last edit:
almost 7 years ago
About this deck:
We are makandra and do test-driven, agile Ruby on Rails software development.
License for source code
Posted by Tobias Kraze to makandra dev
This website uses cookies to improve usability and analyze traffic.
Accept or learn more