search for: before_thumbnail_sav

Displaying 3 results from an estimated 3 matches for "before_thumbnail_sav".

Did you mean: before_thumbnail_saved
2009 Jul 24
1
Attachment_fu - watermark tmp file before saved to S3
...ere, I''d like to use RMagick to watermark an image in the tmp directory before Attachment_fu saves it to Amazon S3. I took a look at the callbacks available in attachment_fu. There''s an ''after_attachment_saved'' method but this would be too late, and a ''before_thumbnail_saved'' but this is no good because it''s for thumbnails. I think I need ''before_attachment_saved'' or the equivalent in the attachment workflow. I do have a watermark working for :file_system storage option using the code below. # -----------------------------------...
2007 Mar 04
3
Dynamically setting the image directory used by attachment_fu
...ou end up with ton of directories under the item_image directory. Instead I wanted the images to be grouped by the item object which has_many item_images. You can do that by adding the following two methods to the item_image object. # Make sure the related item is associated to the thumbnail child before_thumbnail_saved do |record, thumbnail| thumbnail.item = record.item end def full_filename(thumbnail = nil) # Just to be sure the ID gets set raise "Missing Item ID" if item_id.nil? file_system_path = (thumbnail ? thumbnail_class : self).attachment_options[:path_prefix].to_s File.jo...
2007 Apr 17
1
attachment_fu - propagating attributes to thumbnails
I have a model using attachment_fu (via has_attachment) and I''m creating thumbnails for the attached images. I have an extra field ''foo'' that I''m validating on create with validates_presence_of :foo. One problem arises when I upload an image: The ''foo'' is not propogating down to the thumbnails. What should I put in my model to grab the