views:

291

answers:

1

After a photo is uploaded and created using attachment_fu, is there a way to edit just the thumbnails and leave the original as it is? I understand how to do the resizing or cropping, but it's applying the edits to all of the thumbnails and the originals, which is how I'm sure attachment_fu was intended to work.

For example, say in a photo gallery app the user uploads an image and needs to crop the image, but may need to crop it several times. This would require going back to the original image to crop again.

This thread addresses the core issue of just updating thumbnails when cropping (using Kropper): http://groups.google.com/group/attachme … c4d14be02d

Is there a simpler way to to bypass updating the original by hacking or patching attachment_fu?

A: 

I'd think your best bet would be to have the initial image upload be a separate file attachment to your model. You might have something like original_image and cropped_image.

Then when you need to make your edits, just reload from the original image:

# From attachment_fu docs, code to "upload" from local path
@attachable = AttachmentMetadataModel.new(:uploaded_data => ActionController::TestUploadedFile.new(path, mimetype))
@attachable.save
Mike Buckbee