Page 1 of 1

[6.8.7.0 Q16 x64-WIN] Maybe a Bug in Merging .jpg-Files

Posted: 2013-10-14T04:11:23-07:00
by cemetry
Hi @all,

First of all I say thank you for such a great tool. But I think, I've found a bug in merging greyscale-Files in a CMYK-File. I'm using the Windows-64Bit-Version and convert.exe is called by a Powershell-Script (I've also tested to call the convert.exe in an batch, but is also not working).

The Call:

Code: Select all

convert.exe -limit memory 2GiB -colorspace CMYK $cneg.FullName $mneg.Fullname $yneg.FullName $kneg.FullName -combine "C:\Test.jpg"
If I'am using the -monitor command I get these Lines from the Powershell:

Code: Select all

Mogrify image[JPG\TempNeg\cyan.jpg]: 0 of 4, 00% complete
Mogrify image[JPG\TempNeg\magenta.jpg]: 1 of 4, 33% complete
Mogrify image[JPG\TempNeg\yellow.jpg]: 2 of 4, 66% complete
Mogrify image[JPG\TempNeg\black.jpg]: 3 of 4, 100% complete
After That, convert.exe is crashing without an answer in the shell.

Is there any known Solution, which I can use?

Thanks!

Re: [6.8.7.0 Q16 x64-WIN] Maybe a Bug in Merging .jpg-Files

Posted: 2013-10-14T06:06:45-07:00
by snibgo
Hard to say. Perhaps you are running out of memory. Can you provide your input files? Put them somewhere like dropbox.com and paste the URLs here.

I'm not sure that putting "-colorspace CMYK" before any input images does anything.

Re: [6.8.7.0 Q16 x64-WIN] Maybe a Bug in Merging .jpg-Files

Posted: 2013-10-14T11:24:18-07:00
by snibgo
Some experimentation shows that ...

Code: Select all

convert -colorspace CMYK xc: xc: xc: xc: -combine x.jpg
... crashes. But that's a meaningless place to put "-colorspace".

This doesn't crash:

Code: Select all

convert xc: xc: xc: xc: -combine -colorspace CMYK x.jpg

Re: [6.8.7.0 Q16 x64-WIN] Maybe a Bug in Merging .jpg-Files

Posted: 2013-10-14T14:31:50-07:00
by dlemstra
I just tried to run the following with the latest source of ImageMagick:

Code: Select all

convert -colorspace CMYK xc: xc: xc: xc: -combine x.jpg
And this works without crashing. It is possible that this was fixed because we switched to libjpeg-turbo (twice as fast on some tests I ran). Does the problem also occur when you write to a png instead of a jpg file?

Re: [6.8.7.0 Q16 x64-WIN] Maybe a Bug in Merging .jpg-Files

Posted: 2013-10-14T14:47:23-07:00
by snibgo
The more natural way to express this might be:

Code: Select all

convert xc: xc: xc: xc: -combine -set colorspace CMYK x.png
This doesn't crash for PNG but does crash for JPG.


Both following commands crash for both PNG and JPG:

Code: Select all

convert xc: xc: xc: xc: -set colorspace CMYK -combine x.png
convert -set colorspace CMYK xc: xc: xc: xc: -combine x.png
Tested in v6.8.7-0 on Windows 7.

Re: [6.8.7.0 Q16 x64-WIN] Maybe a Bug in Merging .jpg-Files

Posted: 2013-10-14T17:06:23-07:00
by fmw42
Create test sRGB black image and convert to CMYK to see if that works and what the values are in CMYK


convert xc:black xc:black xc:black -combine -colorspace CMYK txt:
# ImageMagick pixel enumeration: 1,1,65535,cmyk
0,0: (0%,0%,0%,100%) #000000000000FFFF cmyk(0,0,0,255)

So the above is fine. So take the cmyk values and create the reverse see http://www.imagemagick.org/Usage/color_ ... bine_other

convert xc:black xc:black xc:black xc:white -set colorspace CMYK -combine -colorspace sRGB txt:
Abort trap

This may be related to the -combine bug report I made before at viewtopic.php?f=3&t=24173


This also does not work:


convert xc:black -colorspace CMYK \
xc:black -compose CopyCyan -composite \
xc:black -compose CopyMagenta -composite \
xc:black -compose CopyYellow -composite \
xc:white -compose CopyBlack -composite \
-colorspace sRGB txt:


# ImageMagick pixel enumeration: 1,1,65535,srgb
0,0: (99.990844586861982179%,99.990844586861982179%,99.990844586861982179%) #FFF9FFF9FFF9 srgb(99.990844586861982179%,99.990844586861982179%,99.990844586861982179%)

which comes out as nearly white.

Re: [6.8.7.0 Q16 x64-WIN] Maybe a Bug in Merging .jpg-Files

Posted: 2013-10-15T19:19:32-07:00
by snibgo
@cemetry: a bug that may have caused your problem has been fixed, in beta release. See thread viewtopic.php?f=3&t=24173

You can get the beta release from http://imagemagick.org/download/beta/ . I downloaded and tried ImageMagick-6.8.7-1~beta20131015-Q16-x86-dll.exe on Windows 7.

I suggest you write your command as:

Code: Select all

convert.exe -limit memory 2GiB $cneg.FullName $mneg.Fullname $yneg.FullName $kneg.FullName -set colorspace CMYK -combine "C:\Test.jpg"

Re: [6.8.7.0 Q16 x64-WIN] Maybe a Bug in Merging .jpg-Files

Posted: 2013-10-16T00:29:50-07:00
by cemetry
Thanks @all,

@snibgo: I've tested it with the latest beta-package, like your version. It is working and I really think that it is much faster than the stable build.
This code

Code: Select all

convert -colorspace CMYK xc: xc: xc: xc: -combine x.jpg
was for testing usage. I've corrected it to the old one like your command.