jhnvz/retina_rails

Is there a way to reprocess images?

Closed this issue · 8 comments

Currently, images that are uploaded after the addition of retina_rails are working, but everything else is not.

Is there a way to refresh all the existing images? I tried using the rake paperclip:refresh CLASS=User task, but no dice.

Thanks for the great gem. Was a breeze to get set up, otherwise.

Thanks for the report. Does the following code work for you?

User.find_each { |u| u.avatar.reprocess! }

If not. I'll write a custom rake task.

Thanks for the fast response. Unfortunately, just tried on the console and no luck.

Also, all of my user avatar's being uploaded are having the extension changed to .jpgs (plural). Not sure if it's part of the same problem or not.

Ex: Uploaded dexter.jpg and have dexter.jpgs and dexter@2x.jpgs.

Here's the declaration in user.rb

has_attached_file :avatar, 
            :styles => {
                :micro => ["40x40#",:jpg], 
                :thumb => ["60x60#",:jpg], 
                :small => ["100x100#",:jpg], 
                :medium => ["250x250#",:jpg], 
                :large_crop => ["640x",:jpg]
            },
        :processors => [:cropper], 
        :default_url => ActionController::Base.helpers.asset_path("ui/missing_avatar.png"), 
        :retina_quality => 40

I need to take a look at the reprocess! method. I don't really understand what's going on over there. I'll take a look tomorrow.

I have the same issue with both reprocessing and .png being pluralized to .pngs

I've already pushed a new version to Rubygems which fixes the pluralization issue. Make sure you add gem 'retina_rails', '0.1.3' to your Gemfile. I'm still looking for a solution to reprocess images. Any help would be appreciated.

I think reprocessing should work with the pluralization fix. Because the original file is being searched as a pluralized version, which it can't find and hence can't reprocess. I'll let you know if the update fixes it

Yep. The pluralization fix also fixes reprocessing

Thanks! Closing this one