diff --git a/config/vendor/imagemagick-6-policy.xml b/config/vendor/imagemagick-6-policy.xml index a35895c7..77765042 100644 --- a/config/vendor/imagemagick-6-policy.xml +++ b/config/vendor/imagemagick-6-policy.xml @@ -49,12 +49,12 @@ --> - - - - - - + + + + + + diff --git a/lib/iiif_print/image_tool.rb b/lib/iiif_print/image_tool.rb index 8d6df030..42898ba2 100644 --- a/lib/iiif_print/image_tool.rb +++ b/lib/iiif_print/image_tool.rb @@ -74,8 +74,11 @@ def im_identify_geometry(lines) # @return [Array] lines of output from imagemagick `identify` def im_identify - cmd = "identify -format 'Geometry: %G\nDepth: %[bit-depth]\nColorspace: %[colorspace]\nAlpha: %A\nMIME type: %m\n' #{path}" - `#{cmd}`.lines + cmd = "identify -limit memory 8GiB -limit map 16GiB -limit disk 50GiB -format 'Geometry: %G\nDepth: %[bit-depth]\nColorspace: %[colorspace]\nAlpha: %A\nMIME type: %m\n' #{path}" + output, status = Open3.capture2(cmd) + Rails.logger.info "Identify command output: #{output}" + Rails.logger.info "Identify command status: #{status}" + output.lines end def im_mime(lines)