2014-04-22 6 views
5

Po próbie wdrożenia procesu zastosowania auto_orient! do moich obrazów otrzymuję ten błąd:Szyny - Zgłoszenia procesu Carrierwave ArgumentError: brak obrazów na tej liście obrazów

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 działa dobrze bez procesu, ale generuje błąd, gdy próbuję przesłać zdjęcia po dodaniu procesu. Oto sposób:

process :fix_exif_rotation 

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

I tu jest moje posty # utworzyć:

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

można również wkleić params – Viren

+0

Parametry: { "utf8" => "✓", "authenticity_token" => "/ UeJdkaHrOf3Uq6TW9Nqbqi + Or8fkW7bmTjGSOlFD6g =", "post" => { "tekst" => "", " 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">}, "commit" => "Opublikuj"} –

+0

to dziwne, że mają sprawdzanie poprawności lub pokazują na białą listę nośną jak biała lista i wszystkie – Viren

Odpowiedz

11

Mam ten sam błąd i naprawić go poprzez zainstalowanie Ghostscript

brew install ghostscript

0

byłem coraz ten sam błąd, ale miał inny problem. Mój kod wyglądał następująco:

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

Usunięto problem z usunięciem (*args).