There are still some issues when using Graphic Magick, as the "--gravity None" value is not allowed with Graphic Magick.

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

B-Prod created an issue. See original summary.

b-prod’s picture

Status: Active » Needs review
StatusFileSize
new4.25 KB
mondrake’s picture

Status: Needs review » Needs work

Thank you.

We need to allow tests for SetCanvas, Background and Mask to run with GraphicsMagick too, and see if they pass locally and/or in TravisCI - DrpalCI cannot run these tests atm.

b-prod’s picture

What am I supposed to do? Just remove the unset($toolkits['ImageMagick-graphicsmagick']); line on the test class for settCanvas?

mondrake’s picture

Issue summary: View changes

Yes, that’s the way to allow tests to run on GM. Actually it’s probably sufficient to remove the entire method that overrides the base providerToolkits.

mondrake’s picture

Status: Needs work » Needs review

Done #4/#5. Test results on TravisCI https://travis-ci.org/mondrake/image_effects/builds/429017955 :

PHPUnit 6.5.13 by Sebastian Bergmann and contributors.
Runtime:       PHP 7.2.10
Configuration: /home/travis/drupal8/core/phpunit.xml.dist
Testing
................E..................F...........................E. 65 / 66 ( 98%)
.                                                                 66 / 66 (100%)
Time: 8.09 minutes, Memory: 688.50MB
There were 2 errors:
1) Drupal\Tests\image_effects\Functional\Effect\SetCanvasTest::testSetCanvasEffect with data set "ImageMagick-graphicsmagick" ('imagemagick', 'imagemagick.settings', array('graphicsmagick', 100, true))
Exception: Warning: Division by zero
template_preprocess_image_style_preview()() (Line: 68)
/home/travis/drupal8/core/lib/Drupal/Core/Test/HttpClientMiddleware/TestHttpClientMiddleware.php:51
/home/travis/drupal8/vendor/guzzlehttp/promises/src/Promise.php:203
/home/travis/drupal8/vendor/guzzlehttp/promises/src/Promise.php:156
/home/travis/drupal8/vendor/guzzlehttp/promises/src/TaskQueue.php:47
/home/travis/drupal8/vendor/guzzlehttp/promises/src/Promise.php:246
/home/travis/drupal8/vendor/guzzlehttp/promises/src/Promise.php:223
/home/travis/drupal8/vendor/guzzlehttp/promises/src/Promise.php:267
/home/travis/drupal8/vendor/guzzlehttp/promises/src/Promise.php:225
/home/travis/drupal8/vendor/guzzlehttp/promises/src/Promise.php:62
/home/travis/drupal8/vendor/guzzlehttp/guzzle/src/Client.php:131
/home/travis/drupal8/vendor/fabpot/goutte/Goutte/Client.php:155
/home/travis/drupal8/vendor/symfony/browser-kit/Client.php:312
/home/travis/drupal8/vendor/symfony/browser-kit/Client.php:522
/home/travis/drupal8/vendor/symfony/browser-kit/Client.php:330
/home/travis/drupal8/vendor/symfony/browser-kit/Client.php:259
/home/travis/drupal8/vendor/behat/mink-browserkit-driver/src/BrowserKitDriver.php:696
/home/travis/drupal8/vendor/behat/mink-browserkit-driver/src/BrowserKitDriver.php:480
/home/travis/drupal8/vendor/behat/mink/src/Element/NodeElement.php:153
/home/travis/drupal8/vendor/behat/mink/src/Element/NodeElement.php:161
/home/travis/drupal8/core/tests/Drupal/Tests/UiHelperTrait.php:100
/home/travis/drupal8/core/tests/Drupal/Tests/UiHelperTrait.php:222
/home/travis/drupal8/modules/contrib/image_effects/tests/src/Functional/ImageEffectsTestBase.php:119
/home/travis/drupal8/modules/contrib/image_effects/tests/src/Functional/Effect/SetCanvasTest.php:46
2) Drupal\Tests\image_effects\Functional\Effect\BackgroundTest::testBackgroundEffect with data set "ImageMagick-graphicsmagick" ('imagemagick', 'imagemagick.settings', array('graphicsmagick', 100, true))
Exception: Warning: Division by zero
template_preprocess_image_style_preview()() (Line: 68)
/home/travis/drupal8/core/lib/Drupal/Core/Test/HttpClientMiddleware/TestHttpClientMiddleware.php:51
/home/travis/drupal8/vendor/guzzlehttp/promises/src/Promise.php:203
/home/travis/drupal8/vendor/guzzlehttp/promises/src/Promise.php:156
/home/travis/drupal8/vendor/guzzlehttp/promises/src/TaskQueue.php:47
/home/travis/drupal8/vendor/guzzlehttp/promises/src/Promise.php:246
/home/travis/drupal8/vendor/guzzlehttp/promises/src/Promise.php:223
/home/travis/drupal8/vendor/guzzlehttp/promises/src/Promise.php:267
/home/travis/drupal8/vendor/guzzlehttp/promises/src/Promise.php:225
/home/travis/drupal8/vendor/guzzlehttp/promises/src/Promise.php:62
/home/travis/drupal8/vendor/guzzlehttp/guzzle/src/Client.php:131
/home/travis/drupal8/vendor/fabpot/goutte/Goutte/Client.php:155
/home/travis/drupal8/vendor/symfony/browser-kit/Client.php:312
/home/travis/drupal8/vendor/symfony/browser-kit/Client.php:522
/home/travis/drupal8/vendor/symfony/browser-kit/Client.php:330
/home/travis/drupal8/vendor/symfony/browser-kit/Client.php:259
/home/travis/drupal8/vendor/behat/mink-browserkit-driver/src/BrowserKitDriver.php:696
/home/travis/drupal8/vendor/behat/mink-browserkit-driver/src/BrowserKitDriver.php:480
/home/travis/drupal8/vendor/behat/mink/src/Element/NodeElement.php:153
/home/travis/drupal8/vendor/behat/mink/src/Element/NodeElement.php:161
/home/travis/drupal8/core/tests/Drupal/Tests/UiHelperTrait.php:100
/home/travis/drupal8/core/tests/Drupal/Tests/UiHelperTrait.php:222
/home/travis/drupal8/modules/contrib/image_effects/tests/src/Functional/ImageEffectsTestBase.php:119
/home/travis/drupal8/modules/contrib/image_effects/tests/src/Functional/Effect/BackgroundTest.php:42
--
There was 1 failure:
1) Drupal\Tests\image_effects\Functional\Effect\MaskTest::testMaskEffect with data set "ImageMagick-graphicsmagick" ('imagemagick', 'imagemagick.settings', array('graphicsmagick', 100, true))
Actual: {0,0,0,127}, Expected: {255,0,255,0}, Distance: 146179, Tolerance: 0
Failed asserting that 146179 is equal to 0 or is less than 0.
/home/travis/drupal8/modules/contrib/image_effects/tests/src/Functional/ImageEffectsTestBase.php:290
/home/travis/drupal8/modules/contrib/image_effects/tests/src/Functional/ImageEffectsTestBase.php:256
/home/travis/drupal8/modules/contrib/image_effects/tests/src/Functional/Effect/MaskTest.php:48
ERRORS!
Tests: 66, Assertions: 2055, Errors: 2, Failures: 1.
1;37mRemaining deprecation notices (5977)
  4023x: \Drupal\Component\Utility\Unicode::strtoupper() is deprecated in Drupal 8.6.0 and will be removed before Drupal 9.0.0. Use mb_strtoupper() instead. See https://www.drupal.org/node/2850048.
    888x in ResizePercentageTest::testResizePercentage from Drupal\Tests\image_effects\Functional\Effect
    338x in WatermarkTest::testWatermarkEffect from Drupal\Tests\image_effects\Functional\Effect
    280x in ImagemagickArgumentsTest::testImagemagickArgumentsEffect from Drupal\Tests\image_effects\Functional\Effect
    238x in TextOverlayTest::testTextOverlayEffect from Drupal\Tests\image_effects\Functional\Effect
    207x in MirrorTest::testMirrorEffect from Drupal\Tests\image_effects\Functional\Effect
    196x in AutoOrientTest::testAutoOrientAllTags from Drupal\Tests\image_effects\Functional\Effect
    195x in ContrastTest::testContrastEffect from Drupal\Tests\image_effects\Functional\Effect
    188x in AutoOrientTest::testAutoOrientEffect from Drupal\Tests\image_effects\Functional\Effect
    181x in AspectSwitcherTest::testAspectSwitcherEffect from Drupal\Tests\image_effects\Functional\Effect
    178x in SetTransparentColorTest::testSetTransparentColorEffect from Drupal\Tests\image_effects\Functional\Effect
    164x in ColorShiftTest::testColorShiftEffect from Drupal\Tests\image_effects\Functional\Effect
    148x in MaskTest::testMaskEffect from Drupal\Tests\image_effects\Functional\Effect
    117x in OpacityTest::testOpacityEffect from Drupal\Tests\image_effects\Functional\Effect
    117x in BrightnessTest::testBrightnessEffect from Drupal\Tests\image_effects\Functional\Effect
    116x in SetCanvasTest::testSetCanvasEffect from Drupal\Tests\image_effects\Functional\Effect
    97x in BackgroundTest::testBackgroundEffect from Drupal\Tests\image_effects\Functional\Effect
    95x in StripMetadataTest::testStripMetadataEffect from Drupal\Tests\image_effects\Functional\Effect
    82x in GaussianBlurTest::testGaussianBlurEffect from Drupal\Tests\image_effects\Functional\Effect
    69x in InvertTest::testInvertEffect from Drupal\Tests\image_effects\Functional\Effect
    39x in InterlaceTest::testInterlaceEffect from Drupal\Tests\image_effects\Functional\Effect
    35x in ConvolutionTest::testConvolutionEffect from Drupal\Tests\image_effects\Functional\Effect
    35x in ConvolutionSharpenTest::testConvolutionSharpenEffect from Drupal\Tests\image_effects\Functional\Effect
    20x in TextOverlayTest::testTextAlter from Drupal\Tests\image_effects\Functional\Effect
  1482x: drupal_set_message() is deprecated in Drupal 8.5.0 and will be removed before Drupal 9.0.0. Use \Drupal\Core\Messenger\MessengerInterface::addMessage() instead. See https://www.drupal.org/node/2774931
    320x in ResizePercentageTest::testResizePercentage from Drupal\Tests\image_effects\Functional\Effect
    116x in ImagemagickArgumentsTest::testImagemagickArgumentsEffect from Drupal\Tests\image_effects\Functional\Effect
    107x in WatermarkTest::testWatermarkEffect from Drupal\Tests\image_effects\Functional\Effect
    86x in MirrorTest::testMirrorEffect from Drupal\Tests\image_effects\Functional\Effect
    78x in AspectSwitcherTest::testAspectSwitcherEffect from Drupal\Tests\image_effects\Functional\Effect
    76x in AutoOrientTest::testAutoOrientEffect from Drupal\Tests\image_effects\Functional\Effect
    76x in AutoOrientTest::testAutoOrientAllTags from Drupal\Tests\image_effects\Functional\Effect
    69x in ContrastTest::testContrastEffect from Drupal\Tests\image_effects\Functional\Effect
    59x in TextOverlayTest::testTextOverlayEffect from Drupal\Tests\image_effects\Functional\Effect
    56x in ColorShiftTest::testColorShiftEffect from Drupal\Tests\image_effects\Functional\Effect
    56x in SetTransparentColorTest::testSetTransparentColorEffect from Drupal\Tests\image_effects\Functional\Effect
    51x in MaskTest::testMaskEffect from Drupal\Tests\image_effects\Functional\Effect
    46x in StripMetadataTest::testStripMetadataEffect from Drupal\Tests\image_effects\Functional\Effect
    43x in BrightnessTest::testBrightnessEffect from Drupal\Tests\image_effects\Functional\Effect
    43x in OpacityTest::testOpacityEffect from Drupal\Tests\image_effects\Functional\Effect
    43x in SetCanvasTest::testSetCanvasEffect from Drupal\Tests\image_effects\Functional\Effect
    40x in GaussianBlurTest::testGaussianBlurEffect from Drupal\Tests\image_effects\Functional\Effect
    34x in InvertTest::testInvertEffect from Drupal\Tests\image_effects\Functional\Effect
    34x in BackgroundTest::testBackgroundEffect from Drupal\Tests\image_effects\Functional\Effect
    17x in InterlaceTest::testInterlaceEffect from Drupal\Tests\image_effects\Functional\Effect
    16x in ConvolutionTest::testConvolutionEffect from Drupal\Tests\image_effects\Functional\Effect
    16x in ConvolutionSharpenTest::testConvolutionSharpenEffect from Drupal\Tests\image_effects\Functional\Effect
  316x: \Drupal\Component\Utility\Unicode::substr() is deprecated in Drupal 8.6.0 and will be removed before Drupal 9.0.0. Use mb_substr() instead. See https://www.drupal.org/node/2850048.
    170x in TextOverlayTest::testTextOverlayEffect from Drupal\Tests\image_effects\Functional\Effect
    56x in ColorShiftTest::testColorShiftEffect from Drupal\Tests\image_effects\Functional\Effect
    49x in TextOverlayTest::testTextAlter from Drupal\Tests\image_effects\Functional\Effect
    20x in SetCanvasTest::testSetCanvasEffect from Drupal\Tests\image_effects\Functional\Effect
    18x in SetTransparentColorTest::testSetTransparentColorEffect from Drupal\Tests\image_effects\Functional\Effect
    2x in TextUtilityTest::testOffsetArgument from Drupal\Tests\image_effects\Unit
    1x in TextUtilityTest::testCapturedOffset from Drupal\Tests\image_effects\Unit
  98x: SafeMarkup::format() is scheduled for removal in Drupal 9.0.0. Use \Drupal\Component\Render\FormattableMarkup. See https://www.drupal.org/node/2549395.
    63x in SettingsFormTest::testSettingsForm from Drupal\Tests\image_effects\Functional
    35x in SettingsFormTest::testJqueryColorpickerSelector from Drupal\Tests\image_effects\Functional
  21x: getPackage() is deprecated in 8.x-2.3, will be removed in 8.x-3.0. Use ImagemagickExecManagerInterface::getPackage() instead. See https://www.drupal.org/project/imagemagick/issues/2938375.
    8x in MaskTest::testMaskEffect from Drupal\Tests\image_effects\Functional\Effect
    5x in SetCanvasTest::testSetCanvasEffect from Drupal\Tests\image_effects\Functional\Effect
  4x in TextOverlayTest::testTextOverlayEffect from Drupal\Tests\image_effects\Functional\Effect
    4x in BackgroundTest::testBackgroundEffect from Drupal\Tests\image_effects\Functional\Effect
  17x: addArgument() is deprecated in 8.x-2.3, will be removed in 8.x-3.0. Use ImageMagickExecArguments::add() instead. See https://www.drupal.org/project/imagemagick/issues/2925780.
    5x in SetCanvasTest::testSetCanvasEffect from Drupal\Tests\image_effects\Functional\Effect
    4x in MaskTest::testMaskEffect from Drupal\Tests\image_effects\Functional\Effect
    4x in TextOverlayTest::testTextOverlayEffect from Drupal\Tests\image_effects\Functional\Effect
    4x in BackgroundTest::testBackgroundEffect from Drupal\Tests\image_effects\Functional\Effect
  17x: addArgument() is deprecated in 8.x-2.3, will be removed in 8.x-3.0. Use ::add() instead. See https://www.drupal.org/project/imagemagick/issues/2925780.
    5x in SetCanvasTest::testSetCanvasEffect from Drupal\Tests\image_effects\Functional\Effect
    4x in MaskTest::testMaskEffect from Drupal\Tests\image_effects\Functional\Effect
    4x in TextOverlayTest::testTextOverlayEffect from Drupal\Tests\image_effects\Functional\Effect
    4x in BackgroundTest::testBackgroundEffect from Drupal\Tests\image_effects\Functional\Effect
  3x: \Drupal\Component\Utility\Unicode::strlen() is deprecated in Drupal 8.6.0 and will be removed before Drupal 9.0.0. Use mb_strlen() instead. See https://www.drupal.org/node/2850048.
    2x in TextOverlayTest::testTextAlter from Drupal\Tests\image_effects\Functional\Effect
    1x in TextUtilityTest::testCapturedOffset from Drupal\Tests\image_effects\Unit
mondrake’s picture

StatusFileSize
new6.22 KB
mondrake’s picture

Status: Needs review » Needs work
mondrake’s picture

StatusFileSize
new6.7 KB
new3.75 KB

Some progress - this is no longer raising deprecations of ImageMagick methods and no errors at image style editing, but still fails the actual effects, https://travis-ci.org/mondrake/image_effects/builds/429071655

Christopher Riley’s picture

This seems to have fixed my issue. I am going to do additional testing but thank you.

anskelt’s picture

This stopped working with 8.x-3.4.

codebymikey’s picture

Version: 8.x-2.x-dev » 4.0.x-dev
Assigned: Unassigned » codebymikey

Looking into this

codebymikey’s picture

Provided a MR implementing the various effects for GraphicsMagick.

When it's not possible to apply certain effects in a single pass, a temp image is created (that'll be deleted at the end of the page request), and used for the desired effect.

And in the event that the effect is just a bit difficult to implement in GM, then it'll fallback to saving the current effects so far into a temporary image, then use that as the source for subsequent effects.

Whilst implementing this, I ran into the #3559034: [gm] Ensure ArgumentMode::PostSource applies after the source issue where arguments were always placed before the source image rather than after (breaking the desired effects).

I think a patch from that issue might be required in order to have the best experience with the effects.

codebymikey’s picture

Status: Needs work » Needs review

Added compatibility, and tests are passing.

codebymikey’s picture

Assigned: codebymikey » Unassigned
mondrake’s picture

Status: Needs review » Needs work
Related issues: +#3552110: Remove manual create() method from plugins

Need to watch #3552110: Remove manual create() method from plugins for avoiding service injection dances.

mondrake’s picture

Related issues: +#3559481: Let ImageToolkit and ImageToolkitOperations plugins be container aware and autowireable