Misha Moroshko
Misha Moroshko

Reputation: 171321

Paperclip: Is that possible to recreate a deleted thumbnail without uploading the original image again?

I use Paperclip like this:

class Asset < ActiveRecord::Base
  has_attached_file :asset, :styles => { :thumb => "80x80>" }, ...

When an image is uploaded, a thumbnail is created successfully.

Suppose, that for some reason, a thumbnail was deleted from the file system.

Is that possible to recreate the thumbnail without uploading the original image again ?

I tried:

Asset.find(16).save    # => true

but the thumbnail wasn't created in the file system.

Upvotes: 1

Views: 416

Answers (1)

eugen
eugen

Reputation: 9226

Have you tried the reprocess! method? Something like

Asset.find(16).asset.reprocess!

Upvotes: 3

Related Questions