Convert Command exiting without generating output File

Post any defects you find in the released or beta versions of the ImageMagick software here. Include the ImageMagick version, OS, and any command-line required to reproduce the problem. Got a patch for a bug? Post it here.
Post Reply
Carter J
Posts: 116
Joined: 2013-12-19T02:20:09-07:00
Authentication code: 6789

Convert Command exiting without generating output File

Post by Carter J »

Hi

I have run a command which converts a tiff image to jpeg file. For this conversion I have used the below command

convert -resample 300 TESTTIF.tif -profile /tmp/test/ICCProfiles/Recommended/USWebCoatedSWOP.icc -profile "/tmp/test/ICCProfiles/Recommended/sRGB Color Space Profile.icm" TESTTIFFTOJPG.jpg

When I am executing the command the below error is displayed in the console and No output file is generated:

*** glibc detected *** convert: double free or corruption (out): 0x00000000007c02a0 ***
======= Backtrace: =========
/lib64/libc.so.6[0x3fa5e75916]
/lib64/libc.so.6[0x3fa5e78443]
/usr/lib64/libMagickCore.so.2(RelinquishMagickMemory+0xf)[0x3c2e4f67ff]
/usr/lib64/libMagickCore.so.2(DestroySplayTree+0x8e)[0x3c2e53c95e]
/usr/lib64/libMagickCore.so.2(DestroyImageProperties+0x36)[0x3c2e508c86]
/usr/lib64/libMagickCore.so.2(DestroyImage+0x113)[0x3c2e4e4253]
/usr/lib64/libMagickWand.so.2(MogrifyImage+0x466b)[0x3c2e0af65b]
/usr/lib64/libMagickWand.so.2(MogrifyImages+0x135)[0x3c2e0b1615]
/usr/lib64/libMagickWand.so.2(ConvertImageCommand+0x2772)[0x3c2e0417d2]
convert[0x400dab]
/lib64/libc.so.6(__libc_start_main+0xfd)[0x3fa5e1ecdd]
convert[0x400bc9]
======= Memory map: ========
00400000-00402000 r-xp 00000000 fd:00 1375361 /usr/bin/convert
00601000-00604000 rw-p 00001000 fd:00 1375361 /usr/bin/convert
007ac000-008bc000 rw-p 00000000 00:00 0 [heap]
3c2e000000-3c2e108000 r-xp 00000000 fd:00 1375615 /usr/lib64/libMagickWand.so.2.0.0
3c2e108000-3c2e307000 ---p 00108000 fd:00 1375615 /usr/lib64/libMagickWand.so.2.0.0
3c2e307000-3c2e30b000 rw-p 00107000 fd:00 1375615 /usr/lib64/libMagickWand.so.2.0.0
3c2e400000-3c2e5ce000 r-xp 00000000 fd:00 1375621 /usr/lib64/libMagickCore.so.2.0.0
3c2e5ce000-3c2e7ce000 ---p 001ce000 fd:00 1375621 /usr/lib64/libMagickCore.so.2.0.0
3c2e7ce000-3c2e81f000 rw-p 001ce000 fd:00 1375621 /usr/lib64/libMagickCore.so.2.0.0
3c2e81f000-3c2e838000 rw-p 00000000 00:00 0
3c41c00000-3c41c04000 r-xp 00000000 fd:00 1447297 /lib64/libuuid.so.1.3.0
3c41c04000-3c41e03000 ---p 00004000 fd:00 1447297 /lib64/libuuid.so.1.3.0
3c41e03000-3c41e04000 rw-p 00003000 fd:00 1447297 /lib64/libuuid.so.1.3.0
3c42600000-3c4265f000 r-xp 00000000 fd:00 1375626 /usr/lib64/libXt.so.6.0.0
3c4265f000-3c4285e000 ---p 0005f000 fd:00 1375626 /usr/lib64/libXt.so.6.0.0
3c4285e000-3c42865000 rw-p 0005e000 fd:00 1375626 /usr/lib64/libXt.so.6.0.0
3c42a00000-3c42a07000 r-xp 00000000 fd:00 1375521 /usr/lib64/libSM.so.6.0.0
3c42a07000-3c42c07000 ---p 00007000 fd:00 1375521 /usr/lib64/libSM.so.6.0.0
3c42c07000-3c42c08000 rw-p 00007000 fd:00 1375521 /usr/lib64/libSM.so.6.0.0
3fa5600000-3fa5620000 r-xp 00000000 fd:00 1103988 /lib64/ld-2.12.so
3fa581f000-3fa5820000 r--p 0001f000 fd:00 1103988 /lib64/ld-2.12.so
3fa5820000-3fa5821000 rw-p 00020000 fd:00 1103988 /lib64/ld-2.12.so
3fa5821000-3fa5822000 rw-p 00000000 00:00 0
3fa5a00000-3fa5a02000 r-xp 00000000 fd:00 1104001 /lib64/libdl-2.12.so
3fa5a02000-3fa5c02000 ---p 00002000 fd:00 1104001 /lib64/libdl-2.12.so
3fa5c02000-3fa5c03000 r--p 00002000 fd:00 1104001 /lib64/libdl-2.12.so
3fa5c03000-3fa5c04000 rw-p 00003000 fd:00 1104001 /lib64/libdl-2.12.so
3fa5e00000-3fa5f89000 r-xp 00000000 fd:00 1103989 /lib64/libc-2.12.so
3fa5f89000-3fa6189000 ---p 00189000 fd:00 1103989 /lib64/libc-2.12.so
3fa6189000-3fa618d000 r--p 00189000 fd:00 1103989 /lib64/libc-2.12.so
3fa618d000-3fa618e000 rw-p 0018d000 fd:00 1103989 /lib64/libc-2.12.so
3fa618e000-3fa6193000 rw-p 00000000 00:00 0
3fa6200000-3fa6217000 r-xp 00000000 fd:00 1104035 /lib64/libpthread-2.12.so
3fa6217000-3fa6417000 ---p 00017000 fd:00 1104035 /lib64/libpthread-2.12.so
3fa6417000-3fa6418000 r--p 00017000 fd:00 1104035 /lib64/libpthread-2.12.so
3fa6418000-3fa6419000 rw-p 00018000 fd:00 1104035 /lib64/libpthread-2.12.so
3fa6419000-3fa641d000 rw-p 00000000 00:00 0
3fa6600000-3fa6683000 r-xp 00000000 fd:00 1103991 /lib64/libm-2.12.so
3fa6683000-3fa6882000 ---p 00083000 fd:00 1103991 /lib64/libm-2.12.so
3fa6882000-3fa6883000 r--p 00082000 fd:00 1103991 /lib64/libm-2.12.so
3fa6883000-3fa6884000 rw-p 00083000 fd:00 1103991 /lib64/libm-2.12.so
3fa6a00000-3fa6a07000 r-xp 00000000 fd:00 1104036 /lib64/librt-2.12.so
3fa6a07000-3fa6c06000 ---p 00007000 fd:00 1104036 /lib64/librt-2.12.so
3fa6c06000-3fa6c07000 r--p 00006000 fd:00 1104036 /lib64/librt-2.12.so
3fa6c07000-3fa6c08000 rw-p 00007000 fd:00 1104036 /lib64/librt-2.12.so
3fa7200000-3fa7215000 r-xp 00000000 fd:00 1104000 /lib64/libz.so.1.2.3
3fa7215000-3fa7414000 ---p 00015000 fd:00 1104000 /lib64/libz.so.1.2.3
3fa7414000-3fa7415000 r--p 00014000 fd:00 1104000 /lib64/libz.so.1.2.3
3fa7415000-3fa7416000 rw-p 00015000 fd:00 1104000 /lib64/libz.so.1.2.3
3fa7600000-3fa760d000 r-xp 00000000 fd:00 1375628 /usr/lib64/libgomp.so.1.0.0
3fa760d000-3fa780c000 ---p 0000d000 fd:00 1375628 /usr/lib64/libgomp.so.1.0.0
3fa780c000-3fa780d000 rw-p 0000c000 fd:00 1375628 /usr/lib64/libgomp.so.1.0.0
3fa8e00000-3fa8e02000 r-xp 00000000 fd:00 1374707 /usr/lib64/libXau.so.6.0.0
3fa8e02000-3fa9002000 ---p 00002000 fd:00 1374707 /usr/lib64/libXau.so.6.0.0
3fa9002000-3fa9003000 rw-p 00002000 fd:00 1374707 /usr/lib64/libXau.so.6.0.0
3fa9600000-3fa9739000 r-xp 00000000 fd:00 1374838 /usr/lib64/libX11.so.6.3.0
3fa9739000-3fa9939000 ---p 00139000 fd:00 1374838 /usr/lib64/libX11.so.6.3.0
3fa9939000-3fa993f000 rw-p 00139000 fd:00 1374838 /usr/lib64/libX11.so.6.3.0Aborted (core dumped)

The size of the file is 10.2MB.
Version of ImageMagick 6.5.4-7
Version of Linux Machine - 2.6.32-279.9.1.el6.x86_64
Last edited by Carter J on 2014-02-12T00:05:40-07:00, edited 2 times in total.
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: Convert Command exits without generationg output File

Post by magick »

The bug is likely fixed in recent releases of ImageMagick. The current version is 6.8.7-10. If you want us to confirm, post a URL to your image and profile and we'll try the conversion and report back whether the conversion completed without complaint.
Carter J
Posts: 116
Joined: 2013-12-19T02:20:09-07:00
Authentication code: 6789

Re: Convert Command exits without generationg output File

Post by Carter J »

Thanks for the quick response, As these files are customer specific, I am not able to provide those files.

While using latest version of ImageMagick - 6.8.7-10, I am facing other issue. For some pdf files converting them into a jpg files the same convert command produced a Black screen Image. For this reason we came back to previous version of ImageMagick (6.5.4-7).
Last edited by Carter J on 2013-12-20T07:13:51-07:00, edited 1 time in total.
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: Convert Command exits without generationg output File

Post by snibgo »

Possibly your PDF files are black text on transparent black background. Jpeg files can't have transparency, and this tends to become black. Setting "-background white" may cure that problem.
snibgo's IM pages: im.snibgo.com
Carter J
Posts: 116
Joined: 2013-12-19T02:20:09-07:00
Authentication code: 6789

Re: Convert Command exits without generationg output File

Post by Carter J »

Thanks @snibgo, I have done this convert command for the PDF document in the following https://www.dropbox.com/s/sewqqca7ii0i9hs/Test_DOC.pdf. The PDF document in the url is generated from a MS Word Document. Can you please let me know the error in this PDF.
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: Convert Command exits without generationg output File

Post by snibgo »

Your PDF has black letters on a transparent background.

I am on Windows 7, IM 6.8.7-0, gs 9.07. The command ...

Code: Select all

convert Test_DOC.pdf t.jpg
... puts black letters on a white background. Sadly, the background colour will depend on the gs version, etc. To ensure transparent pixels are made a particular colour, try:

Code: Select all

convert -background Red Test_DOC.pdf -flatten t.jpg
This should give black letters on a red background. If so, just change "red" to "white".

A better solution might be to tell your PDF-maker not to make backgrounds transparent.
snibgo's IM pages: im.snibgo.com
Carter J
Posts: 116
Joined: 2013-12-19T02:20:09-07:00
Authentication code: 6789

Re: Convert Command exits without generationg output File

Post by Carter J »

Thanks for the reply @snibgo, As we are using Third party component for generating PDF documents. As we have PDF component which can convert jpg files, MS word documents and some other image files to PDF documents. As the pdf which I gave you is MS Word document which we have converted it as a PDF document using that component.

One more question from me is How can we know for these pdfs have transparent backgrounds. As these files are going through a long process and we get lot of files like these, we cannot judge for which files we have to specify this -background. And if a pdf document has background color is red as default, if we run this command then we will get a jpg file having background as white color which is not expected.

Is there any other way in converting these pdf documents to jpg files.
Last edited by Carter J on 2014-01-05T04:08:50-07:00, edited 2 times in total.
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: Convert Command exiting without generating output File

Post by snibgo »

I'm not sure what you are asking. Do you always want to make transparent pixels white? If so then...

Code: Select all

convert -background White Test_DOC.pdf -flatten t.jpg
... will do it. If the PDF has no transparent pixels, this command won't change any.

If you want, you can find whether an image is fully opaque:

Code: Select all

convert Test_DOC.pdf -format "%[opaque]" info:
This returns "true" or "false".
snibgo's IM pages: im.snibgo.com
Carter J
Posts: 116
Joined: 2013-12-19T02:20:09-07:00
Authentication code: 6789

Re: Convert Command exiting without generating output File

Post by Carter J »

Hi snibgo, I tried this -background with reszie option then the output file is generated with black screen.

Following command has been executed:
convert -background White Test_PDF.pdf[0] -resize 800X600 Test_JPG.jpg
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: Convert Command exiting without generating output File

Post by snibgo »

Why didn't you "-flatten"?
snibgo's IM pages: im.snibgo.com
Carter J
Posts: 116
Joined: 2013-12-19T02:20:09-07:00
Authentication code: 6789

Re: Convert Command exiting without generating output File

Post by Carter J »

Yes Its fine now. I have missed it.

Thanks @snibgo....
Post Reply