Displaying 2 results from an estimated 2 matches for "southeastgrav".
2009 Jul 24
1
Attachment_fu - watermark tmp file before saved to S3
...k for s3
def after_attachment_saved
unless self.thumbnail?
dst = Magick::Image.read("#{RAILS_ROOT}/public/#
{self.public_filename}").first
src = Magick::Image.read("#{RAILS_ROOT}/config/
logo.png").first
result = dst.composite(src, Magick::SouthEastGravity,
Magick::OverCompositeOp)
result.write("#{RAILS_ROOT}/public/#{self.public_filename}")
end
end
Now I''m looking for a way to hook into the attachment_fu process and
apply the watermark before the main image is saved to :s3
Or perhaps I''m approac...
2008 Oct 08
0
RangeError (bignum too big to convert into `long'
...cheight*percentcrop) #new height (based on the
percentage of cropping specified by the user)
img = Magick::Image.read(path).first #reads the image specfied by the
user path
img = img.scale(640,480) #scales image to 640x480
img.write"/home/anmol/image.jpg" #scales image to 640x480
img.crop(SouthEastGravity,picwidth,heightchanged).write(cropfile)
end
ERROR :
RangeError (bignum too big to convert into `long''):
/app/controllers/crop_controller.rb:98:in `crop''
/app/controllers/crop_controller.rb:98:in `topcrop''
/app/controllers/crop_controller.rb:233:in `updownevent'...