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.04.3 to 8:6.9.11.60+dfsg-1.3ubuntu0.22.04.5. Post-upgrade, the following code began to fail:
require "rvg/rvg"
rvg = Magick::RVG.new(600, 600) do |canvas|
canvas.background_fill = "white"
end
image = rvg.draw # failure points to this line
image.format = 'jpg'
image.to_blob do |img|
img.quality = 90
img.depth = 8
end
We receive the following error:
Magick::ImageMagickError: unable to open image
5335': No such file or directory @ error/blob.c/OpenBlob/2924 [GEM_ROOT]/gems/rmagick-5.5.0/lib/rvg/misc.rb:528:in
draw’
The error references this line in the rmagick source code: rmagick/rvg/misc.rb#L528.
Our environment details:
• Ubuntu Version: 22.04
• Ruby Version: 3.2.2
• MiniMagick Version: 4.13.2
• RMagick Version: 5.5.0
We have tried the following troubleshooting steps without success:
1. Reinstalled/compiled RMagick
Has anyone else encountered a similar issue after an ImageMagick upgrade? Any suggestions on how to resolve this error would be greatly appreciated.