2014-04-22 65 views
5

嘗試實施應用auto_orient的進程後!我的圖片我收到此錯誤:Rails - Carrierwave進程拋出ArgumentError:此映像列表中沒有圖像

ArgumentError (no images in this image list): 
    app/uploaders/image_uploader.rb:36:in `fix_exif_rotation' 
    app/controllers/posts_controller.rb:12:in `create' 

Carrierwave工作正常,沒有過程,但是當我嘗試添加處理後上傳圖片引發錯誤。具體的過程:

process :fix_exif_rotation 

    def fix_exif_rotation 
    manipulate! do |image| 
     image = image.auto_orient! 
    end 
    end 

這裏是我的職位#創建:

def create 
    @user = User.find(current_user.id) 
    @post = @user.posts.create(params[:post].permit(:text, :image)) 
    redirect_to user_path(@user) 
    end 
+0

你能也粘貼PARAMS – Viren

+0

參數:{ 「UTF8」=> 「✓」, 「authenticity_token」=> 「/ UeJdkaHrOf3Uq6TW9Nqbqi + Or8fkW7bmTjGSOlFD6g =」, 「後」=> { 「文本」=> 「」,「 image「=>#,@ original_filename =」7.jpg「,@ content_type =」image/jpeg「, @ headers =「Content-Disposition:form-data; name = \」post [image] \「; filename = \」7.jpg \「\ r \ nContent-Type:image/jpeg \ r \ n」>}, 「提交」=>「發佈」} –

+0

奇怪確實或顯示在載波像白名單和所有 – Viren

回答

11

我得到了同樣的錯誤,並通過安裝ghostscript的

brew install ghostscript

0

我得到固定它同樣的錯誤,但有一個不同的問題。我的代碼看起來像:

def auto_orient(*args) # remove `(*args)` 
    manipulate! do |img| 
    img = img.auto_orient 
    end 
end 

卸下(*args)固定的問題。

相關問題