Error Code 11

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
Post Reply
mrbushido
Posts: 5
Joined: 2017-02-01T21:17:15-07:00
Authentication code: 1151

Error Code 11

Post by mrbushido »

Hello,

We recently (out of nowhere) started receiving error code 11's when the following ImageMagick command is run using PHP exec:

/usr/bin/convert inline:/home3/company/public_html/wp-content/uploads/blob1.txt inline:/home3/company/public_html/wp-content/uploads/blob2.txt -quality 100 -density 120 /home3/company/public_html/wp-content/uploads/2126_2017_04_14_15_49_40_complete.pdf

This command converts two 64 bit jpeg strings stored in .txt files into a PDF but everytime its ran now I receive no PHP error, no shell error, just a status code of 11

We're running ImageMagick 6.7.6-8 which I understand is pretty old so I'm not sure if that could be the problem

Does anybody have any ideas ? Any help would be greatly appreciated
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Error Code 11

Post by fmw42 »

Just a guess, but I do not think error code 11 is coming from Imagemagick. Did you upgrade anything? Perhaps PHP? Can you test without PHP and run the same convert command in a terminal?

Do all your inline: images fail?

Do your images conform to the information at http://www.imagemagick.org/Usage/files/#inline
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Error Code 11

Post by fmw42 »

I am not a software person, but searching google for exit code 11, I find it could mean a segfault or Resource temporarily unavailable. See http://gsr-linux.blogspot.com/2010/07/l ... codes.html
mrbushido
Posts: 5
Joined: 2017-02-01T21:17:15-07:00
Authentication code: 1151

Re: Error Code 11

Post by mrbushido »

Thanks for the help fmw42,

Update:

Each txt file looks like so : data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAA4QAAASNCAYA etc.

The command also fails when just converting one base64 bit string txt file into a pdf

I ran a strace, I'm receiving the following:

stat("inline:/home3/company/public_html/wp-content/uploads/2017/blob1.txt", 0x7ffc2a4a10c0) = -1 ENOENT (No such file or directory)
42929 stat("inline:/home3/company/public_html/wp-content/uploads/2017/blob1.txt", 0x7ffc2a4a10c0) = -1 ENOENT (No such file or directory)

obviously there is no directory with "inline:" in the name so I'm not sure why it thinks "inline:" is part of the directory

If i take out the "inline:" it creates a pdf again but its just displaying the .txt files content as a pdf
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Error Code 11

Post by fmw42 »

I have never used inline: before. But try running the command from the directory where you have your inline:image.txt file.

Such as inline:blob1.txt and inline:blob2.txt

try putting quotes around your file, such as

"inline:/home3/company/public_html/wp-content/uploads/blob1.txt"

Is that the full path to your file? Is the path correct?
mrbushido
Posts: 5
Joined: 2017-02-01T21:17:15-07:00
Authentication code: 1151

Re: Error Code 11

Post by mrbushido »

The path is definitely correct and it hasn't changed since it was working

I tried the quotes and adding spaces which both seems to break the code so it just writes the byte string to the file

Not sure if there is any alternatives to using "inline:" ?
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Error Code 11

Post by fmw42 »

Is your data properly formatted as base64?

Have you tried the example from http://www.imagemagick.org/Usage/files/#inline? Does that work?
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Error Code 11

Post by fmw42 »

Oddly, that command does not work for me on IM 6.9.8.3 Q16 Mac OSX. However, the <IMG ...> tag does display an image in Firefox for me.

I would suggest you post this issue about the example not working to the bugs forum and see what the IM developers think or perhaps some one else who knows inline: better than I.
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Error Code 11

Post by fmw42 »

I tested some old versions of IM and Anthony's inline: example works for IM 6.9.2.0 or earlier. But fails for IM 6.9.2.1 or later.

This works if all on one line:

Code: Select all

im6920 convert 'inline:data:,R0lGODlhEAAOALMAAOazToeHh0tLS/7LZv/0jvb29t/f3//Ub//ge8WSLf/rhf/3kdbW1mxsbP//mf///yH5BAAAAAAALAAAAAAQAA4AAARe8L1Ekyky67QZ1hLnjM5UUde0ECwLJoExKcppV0aCcGCmTIHEIUEqjgaORCMxIC6e0CcguWw6aFjsVMkkIr7g77ZKPJjPZqIyd7sJAgVGoEGv2xsBxqNgYPj/gAwXEQA7'  b64_folder.gif

EDIT: I have posted this to the bugs forum.
Post Reply