I haven't tested on Windows.

Since alpha4 version, uploading an image seems successful, but no thumbnail nor image is generated, triggering a "This value should be of the correct primitive type" error when saving node.

Tested with png and gm.

Comments

guillermo-simeon created an issue. See original summary.

simgui8’s picture

Reverting 1st line in the parseFileViaIdentify() function to the alpha3 version fix the issue (at least with gm on linux).

simgui8’s picture

StatusFileSize
new831 bytes

Previous patch is inverted...

Here is the right patch.

mondrake’s picture

@guillermo-simeon thank you for your report.

1. Is this happening only with GraphicsMagick? What is your version? With GraphicsMagick 1.3.20 I cannot reproduce that.

2. Are you getting any error logged in the dblog?

3. Can you switch on the debugging option (http://cgit.drupalcode.org/imagemagick/tree/README.txt?id=deeba2c#n148) and report back commands and output?

mondrake’s picture

Title: Image generation is broken » Image generation is broken with GraphicsMagick
Priority: Normal » Critical
Issue tags: +Needs tests

So I checked and indeed it looks like the '%[]' syntax in the -format argument is not supported by GraphicsMagick.

The fix from @guillermo-simeon in #3 can temporarily work.

However:
1) this exposes the fact that we are missing tests for GraphicsMagick integration.
2) if we have both IM and GM installed on the server, then 'identify' may be run against IM even if the toolkit is set to use GM. This is because 'identify -format' is executed, whereas we should execute 'gm identify -format' when GM is selected.

mondrake’s picture

Status: Active » Needs review
StatusFileSize
new11.71 KB

Broader patch with separate -format argument per graphics package and execution of 'gm identify -format' if GM is selected.

Add tests that may pass on DrupalCI (as the actual execution of binaries is skipped given that neither IM nor IM are installed on bots), but locally exposes some failures on GM that need to be addressed.

mondrake’s picture

Issue tags: -Needs tests
StatusFileSize
new1002 bytes
new11.7 KB
mondrake’s picture

StatusFileSize
new11.7 KB

The last submitted patch, 7: 2833315-7.patch, failed testing.

mondrake’s picture

Assigned: Unassigned » mondrake
Status: Needs review » Needs work

More tests to do.

mondrake’s picture

Status: Needs work » Needs review
StatusFileSize
new16.87 KB
new24.6 KB

Some progress, I am not yet happy though for interaction between checkPath/imagemagickExec etc.

While running on GM the same tests that pass with IM, we have 3 points of difference that I could not work out yet:

  1. The 'crop' operation on GIF images produces files that cannot be opened by GD imagecreatefromgif() :( ???
  2. Issues with colors after rotate on PNG files
  3. The CreateNew operation in IM uses -transparent-color for new GIF files, but that is not supported by GM. Tried to use -transparent but that seems not to work.

For these I just created test bypasses, will file separate follow-up issues.

simgui8’s picture

Thanks @mondrake

The patch from #11 works fine.

mondrake’s picture

StatusFileSize
new10.66 KB
new27.88 KB

Thanks for feedback @guillermo-simeon :)

The patch here takes the ::runOsShell method from the 8.x-2.x branch, which is now run from ::checkPath and resolves my unhappiness in #11.

Tests pass locally with both IM and GM. Adding tests for GM is a good addition to prevent future regressions.

If this is confirmed working please RTBC.

simgui8’s picture

The patch from #13 works for me.

Thanks @mondrake

mondrake’s picture

StatusFileSize
new1.98 KB
new27.58 KB

Thank you. One more minor cleanup of the toolkit code and tuning of the tests.

simgui8’s picture

Patch #15 works form me.

Nice work @mandrake

  • mondrake committed ca0d1d3 on 8.x-1.x
    Issue #2833315 by mondrake, guillermo-simeon: Image generation is broken...
mondrake’s picture

Version: 8.x-1.0-alpha4 » 8.x-2.x-dev
Status: Needs review » Patch (to be ported)

OK, committed #15 to 8.x-1.x

Needs porting to 8.x-2.x

mondrake’s picture

StatusFileSize
new24.74 KB
mondrake’s picture

Status: Patch (to be ported) » Needs review

  • mondrake committed b05d3e7 on 8.x-2.x
    Issue #2833315 by mondrake, guillermo-simeon: Image generation is broken...
mondrake’s picture

Status: Needs review » Fixed

Committed #19 to 8.x-2.x

mondrake’s picture

Released 8.x-1.0-alpha5.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.