image_processing icon indicating copy to clipboard operation
image_processing copied to clipboard

magick: no images found for operation `-strip' at CLI arg 1 @ error/operation.c/CLIOption/5481

Open utkarsh2102 opened this issue 9 months ago • 2 comments

Hello,

With Ruby 3.3 and MiniMagick 5.1.2, there are two test failures:

  1) Error:
ImageProcessing::MiniMagick#test_0011_applies loader options:
MiniMagick::Error: `magick -strip test/fixtures/portrait.jpg -auto-orient /tmp/image_processing20250217-18955-l0vx39.jpg` failed with status: 1 and error:
magick: no images found for operation `-strip' at CLI arg 1 @ error/operation.c/CLIOption/5481.

    /usr/share/rubygems-integration/all/gems/mini_magick-5.1.2/lib/mini_magick/shell.rb:20:in `run'
    /usr/share/rubygems-integration/all/gems/mini_magick-5.1.2/lib/mini_magick/tool.rb:85:in `call'
    debian/ruby-image-processing/usr/share/rubygems-integration/all/gems/image_processing-1.14.0/lib/image_processing/mini_magick.rb:64:in `save_image'
    debian/ruby-image-processing/usr/share/rubygems-integration/all/gems/image_processing-1.14.0/lib/image_processing/processor.rb:23:in `call'
    debian/ruby-image-processing/usr/share/rubygems-integration/all/gems/image_processing-1.14.0/lib/image_processing/pipeline.rb:50:in `call_processor'
    debian/ruby-image-processing/usr/share/rubygems-integration/all/gems/image_processing-1.14.0/lib/image_processing/pipeline.rb:28:in `block in call'
    debian/ruby-image-processing/usr/share/rubygems-integration/all/gems/image_processing-1.14.0/lib/image_processing/pipeline.rb:64:in `create_tempfile'
    debian/ruby-image-processing/usr/share/rubygems-integration/all/gems/image_processing-1.14.0/lib/image_processing/pipeline.rb:27:in `call'
    debian/ruby-image-processing/usr/share/rubygems-integration/all/gems/image_processing-1.14.0/lib/image_processing/builder.rb:14:in `block in call!'
    debian/ruby-image-processing/usr/share/rubygems-integration/all/gems/image_processing-1.14.0/lib/image_processing/builder.rb:21:in `instrument'
    debian/ruby-image-processing/usr/share/rubygems-integration/all/gems/image_processing-1.14.0/lib/image_processing/builder.rb:13:in `call!'
    debian/ruby-image-processing/usr/share/rubygems-integration/all/gems/image_processing-1.14.0/lib/image_processing/chainable.rb:60:in `call'
    test/mini_magick_test.rb:125:in `block (2 levels) in <top (required)>'

  2) Error:
ImageProcessing::MiniMagick#test_0012_applies saver options:
MiniMagick::Error: `magick test/fixtures/portrait.jpg -auto-orient +strip /tmp/image_processing20250217-18955-gwn1y5.jpg` failed with status: 1 and error:
magick: option deprecated, unable to execute `+strip' at CLI arg 3 @ error/operation.c/CLIOption/5422.

    /usr/share/rubygems-integration/all/gems/mini_magick-5.1.2/lib/mini_magick/shell.rb:20:in `run'
    /usr/share/rubygems-integration/all/gems/mini_magick-5.1.2/lib/mini_magick/tool.rb:85:in `call'
    debian/ruby-image-processing/usr/share/rubygems-integration/all/gems/image_processing-1.14.0/lib/image_processing/mini_magick.rb:64:in `save_image'
    debian/ruby-image-processing/usr/share/rubygems-integration/all/gems/image_processing-1.14.0/lib/image_processing/processor.rb:23:in `call'
    debian/ruby-image-processing/usr/share/rubygems-integration/all/gems/image_processing-1.14.0/lib/image_processing/pipeline.rb:50:in `call_processor'
    debian/ruby-image-processing/usr/share/rubygems-integration/all/gems/image_processing-1.14.0/lib/image_processing/pipeline.rb:28:in `block in call'
    debian/ruby-image-processing/usr/share/rubygems-integration/all/gems/image_processing-1.14.0/lib/image_processing/pipeline.rb:64:in `create_tempfile'
    debian/ruby-image-processing/usr/share/rubygems-integration/all/gems/image_processing-1.14.0/lib/image_processing/pipeline.rb:27:in `call'
    debian/ruby-image-processing/usr/share/rubygems-integration/all/gems/image_processing-1.14.0/lib/image_processing/builder.rb:14:in `block in call!'
    debian/ruby-image-processing/usr/share/rubygems-integration/all/gems/image_processing-1.14.0/lib/image_processing/builder.rb:21:in `instrument'
    debian/ruby-image-processing/usr/share/rubygems-integration/all/gems/image_processing-1.14.0/lib/image_processing/builder.rb:13:in `call!'
    debian/ruby-image-processing/usr/share/rubygems-integration/all/gems/image_processing-1.14.0/lib/image_processing/chainable.rb:60:in `call'
    test/mini_magick_test.rb:151:in `block (2 levels) in <top (required)>'

178 runs, 254 assertions, 0 failures, 2 errors, 0 skips

...can you please take a look?

utkarsh2102 avatar Mar 15 '25 16:03 utkarsh2102

I am planning on upgrading the Debian MiniMagick package to 5.2.0 in case it matters, although I don't see anything in the changelog that indicates it would address this problem.

sorenstoutner avatar Mar 18 '25 23:03 sorenstoutner

yeah, no - it still fails the same way: https://ci.debian.net/packages/r/ruby-image-processing/testing/amd64/58891172/

utkarsh2102 avatar Mar 20 '25 05:03 utkarsh2102

I observe similar error on Fedora:

  1) Error:
ImageProcessing::MiniMagick#test_0012_applies saver options:
MiniMagick::Error: `magick test/fixtures/portrait.jpg -auto-orient +strip /tmp/image_processing20250814-662-kho7bc.jpg` failed with status: 1 and error:
magick: option deprecated, unable to execute `+strip' at CLI arg 3 @ error/operation.c/CLIOption/5422.

    /usr/share/gems/gems/mini_magick-5.3.0/lib/mini_magick/shell.rb:19:in 'MiniMagick::Shell#run'
    /usr/share/gems/gems/mini_magick-5.3.0/lib/mini_magick/tool.rb:85:in 'MiniMagick::Tool#call'
    lib/image_processing/mini_magick.rb:64:in 'ImageProcessing::MiniMagick::Processor.save_image'
    lib/image_processing/processor.rb:23:in 'ImageProcessing::Processor.call'
    lib/image_processing/pipeline.rb:50:in 'ImageProcessing::Pipeline#call_processor'
    lib/image_processing/pipeline.rb:28:in 'block in ImageProcessing::Pipeline#call'
    lib/image_processing/pipeline.rb:64:in 'ImageProcessing::Pipeline#create_tempfile'
    lib/image_processing/pipeline.rb:27:in 'ImageProcessing::Pipeline#call'
    lib/image_processing/builder.rb:14:in 'block in ImageProcessing::Builder#call!'
    lib/image_processing/builder.rb:21:in 'ImageProcessing::Builder#instrument'
    lib/image_processing/builder.rb:13:in 'ImageProcessing::Builder#call!'
    lib/image_processing/chainable.rb:60:in 'ImageProcessing::Chainable#call'
    test/mini_magick_test.rb:151:in 'block (2 levels) in <top (required)>'

  2) Error:
ImageProcessing::MiniMagick#test_0011_applies loader options:
MiniMagick::Error: `magick -strip test/fixtures/portrait.jpg -auto-orient /tmp/image_processing20250814-662-xjhwtn.jpg` failed with status: 1 and error:
magick: no images found for operation `-strip' at CLI arg 1 @ error/operation.c/CLIOption/5481.

    /usr/share/gems/gems/mini_magick-5.3.0/lib/mini_magick/shell.rb:19:in 'MiniMagick::Shell#run'
    /usr/share/gems/gems/mini_magick-5.3.0/lib/mini_magick/tool.rb:85:in 'MiniMagick::Tool#call'
    lib/image_processing/mini_magick.rb:64:in 'ImageProcessing::MiniMagick::Processor.save_image'
    lib/image_processing/processor.rb:23:in 'ImageProcessing::Processor.call'
    lib/image_processing/pipeline.rb:50:in 'ImageProcessing::Pipeline#call_processor'
    lib/image_processing/pipeline.rb:28:in 'block in ImageProcessing::Pipeline#call'
    lib/image_processing/pipeline.rb:64:in 'ImageProcessing::Pipeline#create_tempfile'
    lib/image_processing/pipeline.rb:27:in 'ImageProcessing::Pipeline#call'
    lib/image_processing/builder.rb:14:in 'block in ImageProcessing::Builder#call!'
    lib/image_processing/builder.rb:21:in 'ImageProcessing::Builder#instrument'
    lib/image_processing/builder.rb:13:in 'ImageProcessing::Builder#call!'
    lib/image_processing/chainable.rb:60:in 'ImageProcessing::Chainable#call'
    test/mini_magick_test.rb:125:in 'block (2 levels) in <top (required)>'

178 runs, 249 assertions, 0 failures, 2 errors, 41 skips

I'd blame ImageMagick for the error, which is indicated by this message:

magick: option deprecated, unable to execute `+strip' at CLI arg 3 @ error/operation.c/CLIOption/5422.

On Fedora, I am using ImageMagick-1:7.1.1.47-3.fc43

voxik avatar Aug 15 '25 11:08 voxik

It seems that the last working version was mini_magick 4.13.2. These test cases fail with mini_magick 5.0.0 onward (keep using ImageMagick-1:7.1.1.47-3.fc43)

voxik avatar Aug 15 '25 13:08 voxik

The difference seems to be that the with mini_magick 4.13.2, there is called convert command:

$ convert -strip test/fixtures/portrait.jpg -auto-orient /tmp/image_processing20250815-2611-zs98du.jpg
WARNING: The convert command is deprecated in IMv7, use "magick" instead of "convert" or "magick convert"

whereas for 5.0.0, there is called magic command:

$ magick -strip test/fixtures/portrait.jpg -auto-orient /tmp/image_processing20250815-2611-zs98du.jpg
magick: no images found for operation `-strip' at CLI arg 1 @ error/operation.c/CLIOption/5481.

voxik avatar Aug 15 '25 15:08 voxik

And it appears the +strip option is deprecated for ages:

https://github.com/ImageMagick/ImageMagick/blob/485edb0144044e0219408a3d110d4d41bbc18118/MagickCore/option.c

voxik avatar Aug 15 '25 15:08 voxik

Removed the failing tests for now, thanks for the investigation.

janko avatar Aug 22 '25 06:08 janko