Converting PSD to JPG/PNG throws SetImageType: Assertion failed - [ImageMagick 7.0.2-10]

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
prolific_space
Posts: 2
Joined: 2016-09-08T21:17:35-07:00
Authentication code: 1151

Converting PSD to JPG/PNG throws SetImageType: Assertion failed - [ImageMagick 7.0.2-10]

Post by prolific_space »

Converting a multi layer PSD file throws following error.

$ convert -flatten sourceFile.psd test.jpg

Code: Select all

convert: MagickCore/attribute.c:1243: SetImageType: Assertion `image != (Image *) ((void *)0)' failed.
$ convert --version

Code: Select all

Version: ImageMagick 7.0.2-10 Q16 x86_64 2016-08-30 http://www.imagemagick.org
Copyright: Copyright (C) 1999-2016 ImageMagick Studio LLC
License: http://www.imagemagick.org/script/license.php
Features: Cipher DPC HDRI OpenMP
Delegates (built-in): bzlib djvu fontconfig freetype jbig jng jpeg lcms lqr lzma openexr pangocairo png tiff wmf x xml zlib
$ identify sourceFile.psd

Code: Select all

sourceFile.psd[0] PSD 3860x1244 3860x1244+0+0 8-bit sRGB 661.4MB 5.690u 0:05.699
sourceFile.psd[1] PSD 3908x2321 3908x2321-276-843 8-bit sRGB 661.4MB 5.800u 0:05.809
sourceFile.psd[2] PSD 3860x542 3860x542-252+0 8-bit sRGB 661.4MB 5.850u 0:05.870
sourceFile.psd[3] PSD 2485x1244 2485x1244+1123+0 8-bit sRGB 661.4MB 5.970u 0:05.980
sourceFile.psd[4] PSD 1251x1240 1251x1240+1955+0 8-bit sRGB 661.4MB 6.070u 0:06.080
sourceFile.psd[5] PSD 449x45 449x45+1453+318 8-bit sRGB 661.4MB 6.000u 0:06.000
sourceFile.psd[6] PSD 484x262 484x262+2127+398 8-bit sRGB 661.4MB 5.930u 0:05.929
sourceFile.psd[7] PSD 1059x687 1059x687+1147-94 8-bit sRGB 661.4MB 5.930u 0:05.939
sourceFile.psd[8] PSD 879x62 879x62+1238+63 8-bit sRGB 661.4MB 5.860u 0:05.870
sourceFile.psd[9] PSD 568x58 568x58+1402+1157 8-bit sRGB 661.4MB 5.770u 0:05.780
sourceFile.psd[10] PSD 545x56 545x56+2331+793 8-bit sRGB 661.4MB 5.690u 0:05.699
sourceFile.psd[11] PSD 545x54 545x54+2331+712 8-bit sRGB 661.4MB 5.620u 0:05.630
sourceFile.psd[12] PSD 484x262 484x262+2369+407 8-bit sRGB 661.4MB 5.550u 0:05.540
sourceFile.psd[13] PSD 552x141 552x141+2328+230 8-bit sRGB 661.4MB 5.460u 0:05.469
sourceFile.psd[14] PSD 3516x2088 3516x2088+148-682 8-bit sRGB 661.4MB 5.420u 0:05.440
sourceFile.psd[15] PSD 3830x1815 3830x1815-2715-125 8-bit sRGB 661.4MB 5.790u 0:05.800
sourceFile.psd[16] PSD 1838x1062 1838x1062-252+182 8-bit sRGB 661.4MB 5.840u 0:05.849
sourceFile.psd[17] PSD 2393x1421 2393x1421+505-203 8-bit sRGB 661.4MB 5.970u 0:05.980
sourceFile.psd[18] PSD 3521x1941 3521x1941+2294-696 8-bit sRGB 661.4MB 6.340u 0:06.350
sourceFile.psd[19] PSD 1838x1062 1838x1062+1272-84 8-bit sRGB 661.4MB 6.380u 0:06.399
sourceFile.psd[20] PSD 543x915 543x915+3317+329 8-bit sRGB 661.4MB 6.350u 0:06.349
sourceFile.psd[21] PSD 790x976 790x976+2858+184 8-bit sRGB 661.4MB 6.330u 0:06.329
sourceFile.psd[22] PSD 3694x330 3694x330+166+914 8-bit sRGB 661.4MB 6.240u 0:06.250
sourceFile.psd[23] PSD 8252x2352 8252x2352-2437-696 8-bit sRGB 661.4MB 7.850u 0:07.859
sourceFile.psd[24] PSD 4143x808 4143x808-252-113 8-bit sRGB 661.4MB 7.790u 0:07.800
sourceFile.psd[25] PSD 4143x531 4143x531-252+977 8-bit sRGB 661.4MB 8.070u 0:08.079
sourceFile.psd[26] PSD 484x48 484x48+1435+328 8-bit sRGB 661.4MB 7.990u 0:08.000
sourceFile.psd[27] PSD 522x283 522x283+2162+419 8-bit sRGB 661.4MB 7.940u 0:07.940
sourceFile.psd[28] PSD 1142x742 1142x742+1104-112 8-bit sRGB 661.4MB 8.000u 0:08.019
sourceFile.psd[29] PSD 969x50 969x50+1192+61 8-bit sRGB 661.4MB 7.930u 0:07.939
sourceFile.psd[30] PSD 716x63 716x63+1325+1131 8-bit sRGB 661.4MB 7.870u 0:07.870
sourceFile.psd[31] PSD 5815x1903 5815x1903-2130-204 8-bit sRGB 661.4MB 7.880u 0:07.889
sourceFile.psd[32] PSD 591x54 591x54+2123+794 8-bit sRGB 661.4MB 7.800u 0:07.799
sourceFile.psd[33] PSD 545x54 545x54+2142+714 8-bit sRGB 661.4MB 7.710u 0:07.719
sourceFile.psd[34] PSD 484x262 484x262+2180+409 8-bit sRGB 661.4MB 7.650u 0:07.660
sourceFile.psd[35] PSD 601x142 601x142+2114+231 8-bit sRGB 661.4MB 7.580u 0:07.589
sourceFile.psd[36] PSD 545x56 545x56+2331+793 8-bit sRGB 661.4MB 7.500u 0:07.510
sourceFile.psd[37] PSD 545x54 545x54+2331+712 8-bit sRGB 661.4MB 7.420u 0:07.429
sourceFile.psd[38] PSD 484x262 484x262+2369+407 8-bit sRGB 661.4MB 7.360u 0:07.359
sourceFile.psd[39] PSD 552x141 552x141+2328+230 8-bit sRGB 661.4MB 7.280u 0:07.289
sourceFile.psd[40] PSD 3860x1244 3860x1244-253+0 8-bit sRGB 661.4MB 7.250u 0:07.250
sourceFile.psd[41] PSD 843x181 843x181+2926+926 8-bit sRGB 661.4MB 7.190u 0:07.199
sourceFile.psd[42] PSD 903x194 903x194+2872+905 8-bit sRGB 661.4MB 7.140u 0:07.140
sourceFile.psd[43] PSD 657x188 657x188+3153+959 8-bit sRGB 661.4MB 7.080u 0:07.079
sourceFile.psd[44] PSD 582x117 582x117+2601+1022 8-bit sRGB 661.4MB 7.000u 0:07.010
sourceFile.psd[45] PSD 649x1050 649x1050+2538+82 8-bit sRGB 661.4MB 7.020u 0:07.029
sourceFile.psd[46] PSD 61x24 61x24+3100+8 8-bit sRGB 661.4MB 6.940u 0:06.949
sourceFile.psd[47] PSD 57x26 57x26+3173+6 8-bit sRGB 661.4MB 6.850u 0:06.859
sourceFile.psd[48] PSD 14x23 14x23+3174+8 8-bit sRGB 661.4MB 6.770u 0:06.769
sourceFile.psd[49] PSD 7x12 7x12+3230+13 8-bit sRGB 661.4MB 6.690u 0:06.689
sourceFile.psd[50] PSD 22x37 22x37+3061+1 8-bit sRGB 661.4MB 6.600u 0:06.609
sourceFile.psd[51] PSD 120x23 120x23+1874+8 8-bit sRGB 661.4MB 6.520u 0:06.529
sourceFile.psd[52] PSD 57x22 57x22+637+8 8-bit sRGB 661.4MB 6.440u 0:06.449
sourceFile.psd[53] PSD 34x26 34x26+720+6 8-bit sRGB 661.4MB 6.360u 0:06.359
sourceFile.psd[54] PSD 3860x1244 3860x1244+0+0 8-bit sRGB 661.4MB 6.320u 0:06.320
sourceFile.psd[55] PSD 25x62 25x62+3241+1175 8-bit sRGB 661.4MB 6.240u 0:06.240
sourceFile.psd[56] PSD 33x60 33x60+3189+1176 8-bit sRGB 661.4MB 6.160u 0:06.160
sourceFile.psd[57] PSD 33x218 33x218+3801+1018 8-bit sRGB 661.4MB 6.090u 0:06.089
sourceFile.psd[58] PSD 25x62 25x62+586+1175 8-bit sRGB 661.4MB 6.010u 0:06.019
sourceFile.psd[59] PSD 33x60 33x60+641+1176 8-bit sRGB 661.4MB 5.920u 0:05.929
sourceFile.psd[60] PSD 33x218 33x218+13+1018 8-bit sRGB 661.4MB 5.850u 0:05.850
sourceFile.psd[61] PSD 3859x1244 3859x1244+1+0 8-bit sRGB 661.4MB 5.810u 0:05.820
sourceFile.psd[62] PSD 644x623 644x623+2343+215 8-bit sRGB 661.4MB 5.790u 0:05.800
sourceFile.psd[63] PSD 825x26 825x26+1064+1188 8-bit sRGB 661.4MB 5.720u 0:05.719
sourceFile.psd[64] PSD 66x45 66x45+988+1174 8-bit sRGB 661.4MB 5.630u 0:05.640
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: Converting PSD to JPG/PNG throws SetImageType: Assertion failed - [ImageMagick 7.0.2-10]

Post by snibgo »

A developer would need to look at this. Please paste a URL to a PSD file that has this problem.
snibgo's IM pages: im.snibgo.com
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Converting PSD to JPG/PNG throws SetImageType: Assertion failed - [ImageMagick 7.0.2-10]

Post by fmw42 »

The developers have recently been working to allow the copying of PSD files with adjustment layers. See the changelog at http://www.imagemagick.org/script/changelog.php where it says:

"2016-08-27 7.0.2-10 Dirk Lemstra <dirk@lem.....org>
Added define 'psd:additional-info' to preserve the additional information in a PSD file."

I think it is -define psd:additional-info=preserve or remove or one other (possibly safe) that I cannot remember at the moment.

dlemstra was supposed to give me those options to modify the documentation, but I have not heard back from him.

I am sure he would like to examine and test your images to see if this is a bug. So as user snibgo said, please supply one or more examples.

Also in IM 7, convert is now magick (though if you installed properly, convert should still work). But the correct syntax is to read the input image right after convert or magick. The command -flatten needs to come after the input. IM 7 is less forgiving of syntax than IM 6

So try

Code: Select all

magick sourceFile.psd -define psd:additional-info=preserve -flatten  test.jpg
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Converting PSD to JPG/PNG throws SetImageType: Assertion failed - [ImageMagick 7.0.2-10]

Post by fmw42 »

Sorry, see edits above.
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Converting PSD to JPG/PNG throws SetImageType: Assertion failed - [ImageMagick 7.0.2-10]

Post by fmw42 »

P.S. you can upload your image to some free hosting service such as dropbox.com and put the URL here. This forum does not allow image uploads.
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Converting PSD to JPG/PNG throws SetImageType: Assertion failed - [ImageMagick 7.0.2-10]

Post by fmw42 »

I do not know if layer groups have been addressed, yet.
prolific_space
Posts: 2
Joined: 2016-09-08T21:17:35-07:00
Authentication code: 1151

Re: Converting PSD to JPG/PNG throws SetImageType: Assertion failed - [ImageMagick 7.0.2-10]

Post by prolific_space »

@fmw42 - Thanks for the reply

Tried with correct syntax throws the same error.
Currently the file with problem is one of the PROD clients. Will get back to you guys ASAP once get permission to share.
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Converting PSD to JPG/PNG throws SetImageType: Assertion failed - [ImageMagick 7.0.2-10]

Post by fmw42 »

If necessary, you can send it privately to dlemstra on this forum or you can send him direct email. He will have to provide you his email address if the latter.

Does your PSD file have other layers besides simple ones, such as adjustment or text layers?

Can you open your file in PS and do a screen snap of just the layers window and provide that as a starter so that we can see if there are non-simple layers?

Does the command give the same error, if you use -define ...=remove?
Post Reply