You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This has been working for us for years as a quick-and-dirty way to check for duplicate images being uploaded to our Ruby on Rails site:
file.blob.open do |temp_file|
file_data = MiniMagick::Image.open(temp_file.path)
file_data.resize '1024x768'
@md5 = Digest::MD5.hexdigest(file_data.get_pixels.join)
# etc.
end
After recent Rails upgrades (I believe it started around 6.0.4; we're gradually moving to 7.0), this started throwing errors like:
/home/jeff/.rvm/gems/ruby-3.1.2/gems/mini_magick-4.11.0/lib/mini_magick/shell.rb:17:in `run': `convert /tmp/mini_magick20221120-1647726-dit0yb.png -depth 8 RGB:-` failed with error: (MiniMagick::Error) convert-im6.q16: unable to write file `-' @ error/constitute.c/WriteImage/1341.
I tracked the problem down to get_pixels. Everything works fine until there, including resizing the image in the previous line. Why do we get this error when calling get_pixels? Why is it trying to write a file when getting the pixels matrix?
Thanks for your help!
Jeff
The text was updated successfully, but these errors were encountered:
There is probably something wrong with get_pixels. I just installed MiniMagick, opened an image and applied get_pixels and my console was left hanging ... (Rails 7, Ruby 3.1.0)
This has been working for us for years as a quick-and-dirty way to check for duplicate images being uploaded to our Ruby on Rails site:
After recent Rails upgrades (I believe it started around 6.0.4; we're gradually moving to 7.0), this started throwing errors like:
I tracked the problem down to
get_pixels
. Everything works fine until there, including resizing the image in the previous line. Why do we get this error when callingget_pixels
? Why is it trying to write a file when getting the pixels matrix?Thanks for your help!
Jeff
The text was updated successfully, but these errors were encountered: