Posts

Showing posts with the label imagemagick

Image Watermark MiniMagick & Rails 5.2

Image Watermark MiniMagick & Rails 5.2 I am trying to watermark the product images from a model. I have set static images for testing but I am getting an error and I don't understand why. Can anyone assist in why I am getting this error: undefined method `composite' for "CIAO12.png":String Current Setup: Rails 5.2 gem 'mini_magick', '~> 4.8' (Included in the Gemfile) Brew install imagemagick (Successful) Code is testing on static images but will be change to the product image instead of the 'CIA012.png' image. Show Action <div class="card-body"> <h5 class="card-title"><%= @product.product_name %></h5> <% if @product.image.attached? %> <%= image_tag(@product.watermark) %> <% end %> </div> Product Model def watermark first_image = "CIAO12.png" second_image = "watermark.png" result = first_image.composite(second_image) do |c| c.compos...