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
When running the tests in Debian, we noticed some tests failures due to a change of output in the verbose identify output with the clipping_path.jpg image in spec/fixtures with Imagemagick 6.9.11.24.
Indeed, the properties now contain the information about the clipping path as a subfield (in addtition to the Clipping path: field.
The logic in the details method in lib/mini_magick/image/info.rb now fails as when the level is -1, the details_hash[last_keys] can be a Hash and not a string in the case of the nested clipping path info inside properties, and the << operator fails.
I came up with this ugly hack to accomodate with the new output
--- ruby-mini-magick-4.9.5.orig/lib/mini_magick/image/info.rb
+++ ruby-mini-magick-4.9.5/lib/mini_magick/image/info.rb
@@ -136,7 +136,13 @@ module MiniMagick
# indentation, resulting in a level of -1
last_key = details_hash.keys.last
details_hash[last_key] = '' if details_hash[last_key].empty?
- details_hash[last_key] << line
+ # hack to accomodate with newer identify output
+ if details_hash[last_key].class==Hash
+ fkey = details_hash[last_key].keys.first
+ details_hash[last_key][fkey] << line
+ else
+ details_hash[last_key] << line
+ end
next
end
I know from the warning that parsing identify output is deprecated for imagemagick, but as it is used in several tests, it is important to ensure for now that it works ok so that failures detect real problems.
The text was updated successfully, but these errors were encountered:
I'm done with attempting to correctly parse the verbose output. Everyone should just use MiniMagick::Image#data, assuming that ImageMagick dumps valid JSON.
Hi!
When running the tests in Debian, we noticed some tests failures due to a change of output in the verbose
identify
output with theclipping_path.jpg
image in spec/fixtures with Imagemagick 6.9.11.24.See:
https://bugs.debian.org/cgi-bin/bugreport.cgi?att=1;bug=966436
and
ImageMagick/ImageMagick6#90
Indeed, the properties now contain the information about the clipping path as a subfield (in addtition to the Clipping path: field.
The logic in the
details
method inlib/mini_magick/image/info.rb
now fails as when the level is -1, thedetails_hash[last_keys]
can be a Hash and not a string in the case of the nested clipping path info inside properties, and the<<
operator fails.I came up with this ugly hack to accomodate with the new output
I know from the warning that parsing identify output is deprecated for imagemagick, but as it is used in several tests, it is important to ensure for now that it works ok so that failures detect real problems.
The text was updated successfully, but these errors were encountered: