Page 1 of 2

Black image output when memory limit is set

Posted: 2015-10-16T03:43:36-07:00
by gaurnitai74
Hi,
We find some regression error with the latest IMagick 6.9.2-4

When we specify [memory, map, area] limits while converting CMYK colorspace PDFs to RGB then the output result is a black image(we are using Ghostscript 9.06 due to licensing limitations).
convert.exe Janmashtami.pdf -limit memory 2MB -limit map 4MB -limit area 8MB -quality 80 -strip -filter Lanczos -colorspace RGB -resize 1280x1280 Janmashtami-286981799.jpg
When we remove the 3 limits then the output is fine. Please let us know if this can be fixed.
Thanks & Regards,
Vimal

Re: Black image output when memory limit is set

Posted: 2015-10-16T04:11:53-07:00
by dlemstra
Can you share your PDF file and tell us your operating system? What are the dimensions of your image?

Re: Black image output when memory limit is set

Posted: 2015-10-19T11:36:17-07:00
by gaurnitai74
Thanks for your response. Please find the link to a sample file:
https://temp-share.com/f/frwktjumvf
https://temp-share.com/f/xfrwktzfxx

OS: Windows Server 2008 R2

Re: Black image output when memory limit is set

Posted: 2015-10-21T02:30:00-07:00
by gaurnitai74
Hi,
Were you able to reproduce the issue?
Thanks in advance,

Re: Black image output when memory limit is set

Posted: 2015-10-21T04:36:31-07:00
by dlemstra
I can reproduce the issue. The limits are probably to low, I will take a look again at it this weekend.

Re: Black image output when memory limit is set

Posted: 2015-10-21T05:21:25-07:00
by magick
The conversion works for us under Linux. What happens if you save to PNG rather than JPEG? If that works try adding
  • -define jpeg:optimize-coding=true
to your command-line. Did that help?

Re: Black image output when memory limit is set

Posted: 2015-10-21T05:24:08-07:00
by gaurnitai74
Hi,
Thank you for the response. We find that this worked fine in 6.8.8-10. We hit this issue when migrating to the latest version 6.9.2-4. This issue occurs even with some jpg images as small as 90kb. I will share it as well for your reference.
Thanks in advance,

Re: Black image output when memory limit is set

Posted: 2015-10-21T05:30:29-07:00
by gaurnitai74
magick wrote:The conversion works for us under Linux. What happens if you save to PNG rather than JPEG? If that works try adding
  • -define jpeg:optimize-coding=true
to your command-line. Did that help?
PNG output works fine but the above code did not help. We need jpg output. As I mentioned, this works fine in 6.8.8, so something has broken.
Thank you,

Re: Black image output when memory limit is set

Posted: 2015-10-21T10:29:55-07:00
by gaurnitai74
Black output when limits are set.

https://temp-share.com/f/cxfrwklioc

convert.exe city.JPG[0] -limit memory 2048 -limit map 4096 -limit area 8192 -quality 80 -strip -filter Lanczos -profile "sRGB Color Space Profile.icm" -colorspace RGB -resize 640x480 city768088308.jpg

Re: Black image output when memory limit is set

Posted: 2015-10-21T10:50:25-07:00
by fmw42
Your command and image works fine for me on IM 6.9.2.4 Q16 Mac OSX SnowLeopard

Code: Select all

convert city.JPG[0] -limit memory 2048 -limit map 4096 -limit area 8192 -quality 80 \
-strip -filter Lanczos -profile /Users/fred/images/profiles/sRGB.icc -colorspace RGB \
-resize 640x480 city768088308.jpg
Note I used my sRGB.icc profile rather than your .icm one. I do not know if this might be the issue or not. see http://www.color.org/srgbprofiles.xalter

Or perhaps this is a Windows only issue?

Re: Black image output when memory limit is set

Posted: 2015-10-22T21:24:48-07:00
by gaurnitai74
Hello,
Thanks for the response. I removed -profile & .icm profile altogether but the black jpg output persists.

Code: Select all

convert city.JPG[0] -limit memory 2048 -limit map 4096 -limit area 8192 -quality 80 -strip -filter Lanczos -colorspace RGB -resize 640x480 city768088308.jpg
Best Regards

Re: Black image output when memory limit is set

Posted: 2015-10-22T22:40:04-07:00
by snibgo
On Windows 8.1, IM 6.9.1-6, I get a black image. The problem is cured by removing "-limit map 4096", or setting it to at least 2MB.

It looks like a bug to me.

Re: Black image output when memory limit is set

Posted: 2015-10-29T02:14:27-07:00
by gaurnitai74
Hi,
Can you please let us know if this is scoped to be fixed in the near future?
Thanks in advance,

Re: Black image output when memory limit is set

Posted: 2015-10-29T04:03:42-07:00
by dlemstra
I was unable to track down why it happened this weekend. Since I have to combine IM with a full time job I won't be able to tell you when this will be fixed.

Re: Black image output when memory limit is set

Posted: 2015-10-29T05:52:43-07:00
by gaurnitai74
Hi Dlemstra,
Thank you for your response. I tried ImageMagick 6.9.0-7 and it works without issues. We will freeze on this version for an upcoming project. Appreciate all your help.
Best Regards,