exif image rotation issue using carrierwave and rmagick to upload to s3

前端 未结 4 1655
自闭症患者
自闭症患者 2020-11-30 03:36

I\'ve got a photo upload feature in my rails app. The app uploads direct to s3 through carrierwave via rmagick and fog. The issue I am having is when a photo is uploaded via

4条回答
  •  自闭症患者
    2020-11-30 03:41

    My solution (quite similar to Sumeet) :

    # painting_uploader.rb
    process :right_orientation
    def right_orientation
      manipulate! do |img|
        img.auto_orient
        img
      end
    end
    

    It's really important to return an image. Otherwise, you'll get an

    NoMethodError (undefined method `write' for "":String):
    

提交回复
热议问题