title: Carrierwave gem Video upload and thumbnail generation with rotation
body: <p>I am using Carrierwave gem to upload video recorded from iPhone and create thumbnails of video uploaded using <a href="https://github.com/evrone/carrierwave-video-thumbnailer" rel="nofollow">carrierwave-video-thumbnailer gem</a>.</p>
  
  <p>Now I am facing issue with rotating thumbnail image that was generated by carrierwave-video-thumbnailer gem. I need to rotate to portrait based on video orientation. </p>
  
  <p>Please see my VideoUploader class below.</p>
  
  <pre><code>class VideoUploader &lt; CarrierWave::Uploader::Base
    include CarrierWave::Video
    include CarrierWave::Video::Thumbnailer
  
    # Include RMagick or MiniMagick support:
    # include CarrierWave::RMagick
    # include CarrierWave::MiniMagick
  
    storage :file
  
    def store_dir
      "uploads/#{model.class.to_s.underscore}/#{mounted_as}/#{model.id}"
    end
  
    version :thumb do
      process thumbnail: [{format: 'jpg', quality: 7, size: 640, strip: false, logger: Rails.logger}]
      def full_filename for_file
        png_name for_file, version_name
      end
      process :set_content_type_jpg
    end
  
    def png_name for_file, version_name
      %Q{#{version_name}_#{for_file.chomp(File.extname(for_file))}.jpg}
    end
  
    def set_content_type_jpg(*args)
      Rails.logger.debug "#{file.content_type}"
      self.file.instance_variable_set(:@content_type, "image/jpeg")
    end
  end
  </code></pre>