Error reading multi-layer XCF (gimp) file.
Prerequisites
- [x] I have written a descriptive issue title
- [x] I have verified that I am using the latest version of ImageMagick
- [x] I have searched open and closed issues to ensure it has not already been reported
Description
Some multi-layer GIMP files fail to convert with a memory error.
Steps to Reproduce
When I try to convert this file to .jpg, I get the error below.
magick convert -alpha on -background none -layers merge pages/02-01-00-left.xcf figures/02-01-00-left.jpg
convert: insufficient image data in file `pages/02-01-00-left.xcf' @ error/xcf.c/ReadOneLayer/810.
convert: memory allocation failed `pages/02-01-00-left.xcf' @ error/xcf.c/ReadXCFImage/1357.
convert: no images defined `figures/02-01-00-left.jpg' @ error/convert.c/ConvertImageCommand/3275.
If I merge down the two layers of my xcf file, the command works as expected.
System Configuration
- ImageMagick version:
Version: ImageMagick 7.0.7-15 Q16 x64 2017-12-17 http://www.imagemagick.org Copyright: Copyright (C) 1999-2015 ImageMagick Studio LLC License: http://www.imagemagick.org/script/license.php Visual C++: 180040629 Features: Cipher DPC Modules OpenMP Delegates (built-in): bzlib cairo flif freetype gslib jng jp2 jpeg lcms lqr openexr pangocairo png ps raw rsvg tiff webp xml zlib
- Environment (Operating system, version and so on): Windows 10
- Additional information:
Whoops, looks like this was already addressed in #697
Looks like #697 was on version 6.9.9-9, I'm running a newer version and still seeing this behavior. 697 is closed, perhaps the fix only went into version 6.9.x?
I don't know if this will help, but your syntax is wrong for IM 7. IM 7 is not forgiving as IM 6. First remove convert from your command. All that is needed now is magick. Then put the input image first before any settings or operators. Try this:
magick pages/02-01-00-left.xcf -alpha on -background none -layers merge figures/02-01-00-left.jpg
@fmw42 Thanks for the tip on syntax, I didn't realize things had changed significantly between versions.
Unfortunately, I still get the same error when using your corrected syntax.
Sorry that did not work.
FYI, the syntax has always been this way since IM 6 -- input, settings, operators, output. The main change is that IM 7 follows this strictly. IM 6 was forgiving. The other change is that convert is replaced by magick. But for identify, montage, mogrify, they need to be prefaced by magick.
Version 6.9.9-11 works for my needs. Leaving this open as it appears to be a bug in 7.
Thanks for the problem report. We can reproduce it and will have a patch to fix it in GIT master branch @ https://github.com/ImageMagick/ImageMagick later today. The patch will be available in the beta releases of ImageMagick @ https://www.imagemagick.org/download/beta/ by sometime tomorrow.