Page 2 of 2

Re: JPG file failed to convert with new version of Image Magick

Posted: 2019-03-27T14:11:34-07:00
by fmw42
With IM 7.0.8.35 Q16 Mac OSX, magick identify show the xmp error. But

Code: Select all

magick test5p.pdf tmp_%d.jpg
Produces the output images fine even though it shows that xmp error.

On the other hand, IM 6.9.10.35 Q16 Mac OSX shows no error when running the following and produces the same output images.

Code: Select all

convert test5p.pdf tmp_%d.jpg
IM 6 is a bit more forgiving. IM 7 is more strict and does more error checking.

Note that since you are running IM 7, you should be using magick rather than convert in your PHP exec command.

What tool created your PDF file?

Re: JPG file failed to convert with new version of Image Magick

Posted: 2019-03-27T15:05:46-07:00
by maxjac
The PDF file was created using MS Word (latest version)

Re: JPG file failed to convert with new version of Image Magick

Posted: 2019-03-27T17:02:41-07:00
by fmw42
If you create the PDF with some other tool, does Imagemagick give the same error? Might MS Word be the culprit? Do you get the error if you create a single page PDF with MS Word?

Re: JPG file failed to convert with new version of Image Magick

Posted: 2019-03-27T17:13:54-07:00
by maxjac
Confirmed. This warning/error message is raised on PDF files created with MS Word. I tested with other PDF files and the warning/error doesn't come up.

Re: JPG file failed to convert with new version of Image Magick

Posted: 2019-03-27T17:15:12-07:00
by fmw42
I created a single page PDF from MS Word on my Mac and when I convert it with IM 7, I get the same xmp error. Also magick identify shows the same error message, but there is no xmp profile listed.

I do not know what to tell you. Perhaps MS Word is adding a malformed xmp profile.

So I will leave it to the IM developers to look into this further.

Re: JPG file failed to convert with new version of Image Magick

Posted: 2019-06-07T15:12:16-07:00
by tdavidson
I am wondering if there has been any movement on this case sense the last post from March.

We have a fairly new install of Omeka and the IM service is not making the preview images from any of our PDF's. Standard images thumbnails are working correctly for other file formats. Our Archival team says that some of them have been created from Word documents but I do not have an accurate count of what is and isn't created.

A test of a standard .pdf downloaded from the web converts to jpg without error.

I have just upgraded our IM from a previous build, I believe -38, to the newest 7.0.8-49 and the error is still present.

Re: JPG file failed to convert with new version of Image Magick

Posted: 2019-06-08T14:10:26-07:00
by ndbroadbent
I'm still seeing this XMP error for ImageMagick 7.0.8-45 and 7.0.8-48 (the latest version.)

Code: Select all

magick --version
# Version: ImageMagick 7.0.8-45 Q16 x86_64 2019-05-18 https://imagemagick.org
# (Same results with: ImageMagick 7.0.8-48 Q16 x86_64 2019-06-08)
cd /tmp 
curl -O http://maximejacques.com/pdf/test5p.pdf
magick test5p.pdf test5p.jpg
# magick: CorruptImageProfile `xmp' @ warning/profile.c/SetImageProfileInternal/1772.
I didn't know much about XMP metadata before, so this article was helpful: https://www.pdflib.com/pdf-knowledge-ba ... -overview/.

The same site also has this online XMP validator tool: https://www.pdflib.com/pdf-knowledge-ba ... validator/

I uploaded the test5p.pdf PDF, and it parsed the XMP data, and validated it against all of the available PDF/A standards (PDF/A-1 and PDF/A-2/3). The validation tool reported that the XMP data is valid and doesn't contain any errors:

Code: Select all

<?xpacket begin="" id="W5M0MpCehiHzreSzNTczkc9d"?><x:xmpmeta xmlns:x="adobe:ns:meta/" x:xmptk="3.1-701">
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
<rdf:Description rdf:about=""  xmlns:pdf="http://ns.adobe.com/pdf/1.3/">
<pdf:Producer>Microsoft® Word for Office 365</pdf:Producer></rdf:Description>
<rdf:Description rdf:about=""  xmlns:dc="http://purl.org/dc/elements/1.1/">
<dc:creator><rdf:Seq><rdf:li>Maxime Jacques</rdf:li></rdf:Seq></dc:creator></rdf:Description>
<rdf:Description rdf:about=""  xmlns:xmp="http://ns.adobe.com/xap/1.0/">
<xmp:CreatorTool>Microsoft® Word for Office 365</xmp:CreatorTool><xmp:CreateDate>2019-03-14T23:06:56-04:00</xmp:CreateDate><xmp:ModifyDate>2019-03-14T23:06:56-04:00</xmp:ModifyDate></rdf:Description>
<rdf:Description rdf:about=""  xmlns:xmpMM="http://ns.adobe.com/xap/1.0/mm/">
<xmpMM:DocumentID>uuid:95F67DEE-BC1B-4AE4-A2B9-A4D4D999339B</xmpMM:DocumentID><xmpMM:InstanceID>uuid:95F67DEE-BC1B-4AE4-A2B9-A4D4D999339B</xmpMM:InstanceID></rdf:Description>

The converted images are totally fine, but the output is just a bit annoying for me. I have a test suite that runs through a lot of PDF processing functionality, so the test suite output looks like this:

Code: Select all

.............identify: CorruptImageProfile `xmp' @ warning/profile.c/SetImageProfileInternal/1772.
convert: CorruptImageProfile `xmp' @ warning/profile.c/SetImageProfileInternal/1772.
.identify: CorruptImageProfile `xmp' @ warning/profile.c/SetImageProfileInternal/1772.
convert: CorruptImageProfile `xmp' @ warning/profile.c/SetImageProfileInternal/1772.
........................identify: CorruptImageProfile `xmp' @ warning/profile.c/SetImageProfileInternal/1772.
convert: CorruptImageProfile `xmp' @ warning/profile.c/SetImageProfileInternal/1772.
.identify: CorruptImageProfile `xmp' @ warning/profile.c/SetImageProfileInternal/1772.
convert: CorruptImageProfile `xmp' @ warning/profile.c/SetImageProfileInternal/1772.
..........

I don't really want to use the -quiet flag, in case I miss something important in a future version. Would be great if this could be fixed!

Re: JPG file failed to convert with new version of Image Magick

Posted: 2019-09-26T04:50:50-07:00
by Jordan616
I also see this error:

Code: Select all

magick: CorruptImageProfile `xmp' @ warning/profile.c/SetImageProfileInternal/1771.
when I'm trying to combine two images with this comand:

Code: Select all

@echo off
setlocal enabledelayedexpansion

for /f "tokens=1,2 delims=:" %%x in ('magick 0.jpg 1.jpg -shave 2x2 -fuzz 2%% -trim +repage -set option:dim "%%[fx:max(u.w,v.w)]" -filter Catrom -resize "%%[dim]" -unsharp 0x1+0.5+0.05 -append -format %%w:%%h +write info: NULL:') do set /a "w=%%x,h=%%y"

set /A wt=%w%*2

echo %wt% : %h%
pause

if !wt! LSS !h! (call :#a) else (call :#b)
exit

:#a
magick 0.jpg -shave 2x2 -fuzz 2%% -trim +repage -quality 100 "03.jpg"
exit /b

:#b
magick 0.jpg 1.jpg -shave 2x2 -fuzz 2%% -trim +repage -set option:dim "%%[fx:max(u.w,v.w)]" -filter Catrom -resize "%%[dim]" -unsharp 0x1+0.5+0.05 -append -quality 100 "00.jpg"
exit /b
Is it possible to fix that?
Original files:
File 0: https://yadi.sk/i/ngyruCHQRFsFXQ
File 1: https://yadi.sk/i/r3bk6UbAY8J3lg
Version: ImageMagick 7.0.8-66 Q16 x64 2019-09-22

Re: JPG file failed to convert with new version of Image Magick

Posted: 2019-09-26T05:38:50-07:00
by snibgo
It's a warning, not an error, so IM should still process the image. Does it?

You can use "-quiet" to supress warnings, if you want.

exiftool confirms the corrupt XMP profile in 1.jpg.

Re: JPG file failed to convert with new version of Image Magick

Posted: 2019-09-26T06:06:27-07:00
by Jordan616
Yes, the image was created. If I add "-quiet" how do I know when an error occured?

Re: JPG file failed to convert with new version of Image Magick

Posted: 2019-09-26T07:58:50-07:00
by snibgo
"-quiet" will supress warning messages. It does not supress error messages.

Re: JPG file failed to convert with new version of Image Magick

Posted: 2019-09-26T11:35:47-07:00
by Jordan616
I added "-quiet", and it didn't change anytging. I still see this warning:

Code: Select all

@echo off
setlocal enabledelayedexpansion

for /f "tokens=1,2 delims=:" %%x in ('magick 0.jpg 1.jpg -shave 2x2 -fuzz 2%% -trim +repage -set option:dim "%%[fx:max(u.w,v.w)]" -filter Catrom -resize "%%[dim]" -unsharp 0x1+0.5+0.05 -append -format %%w:%%h +write info: NULL:') do set /a "w=%%x,h=%%y"

set /A wt=%w%*2

echo %wt% : %h%
pause

if !wt! LSS !h! (call :#a) else (call :#b)
exit

:#a
magick 0.jpg -shave 2x2 -fuzz 2%% -trim +repage -quality 100 -quiet "03.jpg"
exit /b

:#b
magick 0.jpg 1.jpg -shave 2x2 -fuzz 2%% -trim +repage -set option:dim "%%[fx:max(u.w,v.w)]" -filter Catrom -resize "%%[dim]" -unsharp 0x1+0.5+0.05 -append -quality 100 -quiet "00.jpg"
exit /b

Re: JPG file failed to convert with new version of Image Magick

Posted: 2019-09-26T14:05:42-07:00
by fmw42
1.jpg converts to another JPG fine for me. I get a message about the bad tmp profile, but the output is created.

No message is presented by adding -quiet before the input.

Code: Select all

convert -quiet 1.jpg x.jpg
or

Code: Select all

magick -quiet 1.jpg x.jpg
Using IM 6.9.10.65 Q16 and IM 7.0.8.65 Q16 Mac OSX

Re: JPG file failed to convert with new version of Image Magick

Posted: 2019-09-27T01:18:23-07:00
by Jordan616
Thank you!

Re: JPG file failed to convert with new version of Image Magick

Posted: 2019-10-10T13:47:08-07:00
by tomaszg
I'm using imagemagick-7.0.8.64. While it is true that "convert" produces only a warning, C++ API still throws an exception and thus no image is produced.