Media watermark

Inside my bootloader:

version :profile do
    process :resize_to_fill => [300, 300]
    process :quality => 90
    process :watermark
  end

      

then:

  def watermark
    manipulate! do |img|
      logo = Magick::Image.read("#{Rails.root}/assets/images/watermarks/watermark.png").first
      img = img.composite(logo, Magick::SouthEastGravity, Magick::OverCompositeOp)
    end
  end

      

  • above will not work while imagemagick is installed.
  • no errors, so very difficult to debug

  • Is there a way to debug and fix the above code to create a working watermark for the carrier?

+3


source to share


1 answer


Where is the line where you write the result to disk?

I believe the method composite

itself does not write the result to disk. You have to call img.write('composite.gif')

(or whatever filename you want) to actually save the composite result.



I suppose this is possible for the carrier, but can you verify this by checking the output file content and / or timestamps to see if the file has been modified after upload?

Link: http://rmagick.rubyforge.org/src_over.html - about half way down the page

+5


source







All Articles