Add ability to dynamically generate resized images without calling object's save method #105

Closed
drpentode opened this Issue Oct 16, 2009 · 1 comment

Projects

None yet

2 participants

@drpentode

We had the need to dynamically generate new images after an attachment is uploaded. For example, our designer might need a non-standard image size to fit a new template, or a client would be customizing their site and need a smaller version of their uploaded image.

To accomplish this, I created a gem that overrides the Paperclip::Attachment.method_missing to take resize parameters. The gem is called attachment_on_the_fly, and it's located at http://gemcutter.org/gems/attachment_on_the_fly.

In order to use this gem, install it, require it in a model using Paperclip, and call it using methods like this:

my_obj.my_attachment.s_400_width
my_obj.my_attachment.s_400_height
my_obj.my_attachment.s_640_480

I chose not to use a Processor because Processors only fire when the save method is called, and this did not work with my team's workflow.

If you find this functionality useful, feel free to integrate it with Paperclip (I can make a patch for you), send me comments, ideas, issues, etc.

@sikachu sikachu closed this Jun 28, 2011
@sikachu sikachu reopened this Jun 28, 2011
Contributor
sikachu commented Jun 30, 2011

I think what would be better would be letting you maintain the gem, while we make a link to your project. Thanks a lot for making this! :D

@sikachu sikachu closed this Jun 30, 2011
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment