351 questions
0 votes
0 answers
48 views
MiniMagick/ImageMagick produces Grayscale PDFs(contains colourful images) inside Docker, but Color PDFs Locally (Rails 8)
The Problem Statement My Rails 8 application uses MiniMagick to composite multiple color JPEG/PNG images onto a single blank page, draw bounding boxes, and output the result as a PDF. When running the ...
0 votes
0 answers
66 views
Migrating existing data from Paperclip to Active Storage in Rails 6.1 without re-upload
We are migrating our codebase from paperclip to active storage Below is the example of how we use paperclip: has_attached_file :logo, styles: { small: "x36", medium: "x108", ...
0 votes
0 answers
66 views
Image variants are not processed in Rails 7.0.8 using mini_magick
I have recently upgraded from rails 5.2 to rails 7.0.8 and I am using mini_magick to create image variants. But somehow the image variants are not created. Gem used: 'image_processing', '~> 1.14' ...
0 votes
1 answer
65 views
Minimagic not showing the correct font defined in the image creation
# frozen_string_literal: true class UserUploader < ApplicationUploader include CarrierWave::MiniMagick def generate_image(text) tmp_path = File.join(Dir.tmpdir, "#{SecureRandom.hex}....
0 votes
1 answer
62 views
How to automatically update dominant color of an image in Rails 7 using MiniMagick after image upload or change?
I am working on a Rails 7 application and I'm trying to implement a feature where I calculate and update the dominant color of an event image whenever it is uploaded or changed. I'm using MiniMagick ...
0 votes
0 answers
85 views
Can't Render Emojis Using MiniMagick in Ruby on Rails
Could you please help me with generating images that include emojis? Currently, I'm failing to load the font and getting the following error: MiniMagick::Error in HomeController#index `mogrify -...
1 vote
0 answers
82 views
Minor ImageMagick upgrade on Ubuntu Causes Magick::ImageMagickError in Ruby
After a recent security update to ImageMagick on our Ubuntu server, we started encountering an issue with our Ruby code. We upgraded the ImageMagick package from version 8:6.9.11.60+dfsg-1.3ubuntu0.22....
0 votes
1 answer
203 views
issue with image processing & mini magic gems in rails 7 while creating image variants in active storage
in my rails Application I have the following code. class ProjectImage < ApplicationRecord belongs_to :project has_many_attached :images do |attachable| attachable.variant :...
0 votes
1 answer
248 views
How to Add a Resized Image to an Existing PDF Using Ruby on Rails?
I'm working on a Ruby on Rails project, and my goal is to add a resized image, specifically a signature, to an existing PDF. I want to emphasize that I'm looking to add a simple image, not a complex ...
0 votes
1 answer
48 views
Rails MiniMagick How to get info: value?
I want to remove black bars from the image and found that bash script that works well margin=$(convert input.jpg -fuzz 10% -set page "%[@]" -format "%[fx:h-page.height-page.y]" ...
0 votes
1 answer
107 views
Rails: ImageMagick "`identify -format" command fails in Rails
I'm using Rails with mini_magick and my code fails on call of image.size with such exception: `identify -format %m %w %h %b /tmp/RackMultipart20231025-217-shzlwd.png[0]` failed with error: > ...
0 votes
0 answers
53 views
Rails / Prawn Image From Active Storage Color modified
I'm looking for your help regarding an issue i have with on Rails with Prawn(Gem for PDF) when adding an image from Active Storage. When using the image on the app there is no issue but when i add the ...
4 votes
1 answer
441 views
How do I preserve the transparent background when converting an SVG file to PNG with MiniMagick in a Ruby on Rails application?
I am trying to automatically convert SVG images to PNG with Minimagick. I have a Rails application where I need to automatically convert uploaded SVG files. The app runs on Heroku. These SVGs ...
0 votes
0 answers
162 views
Checking for image dimension before performing a resize in Rails
I want to do an initial check for an image's dimensions. If it is greater than 1000, then I want to apply a resize. Is this the right way to approach the problem? I'm creating an image twice. 1st time ...
0 votes
3 answers
709 views
CarrierWave / MiniMagick not updating file extension after convert
I'm using MiniMagick with CarrierWave to process some images on a Rails 5.2 app. My goal is to convert the original image to jpg, and create two other versions (resized). My issue is that while the &...