Page 1 of 1

Cannot process file page when the file path contains colon

Posted: 2015-10-18T23:49:33-07:00
by tlichev
Hi all,
I already reported such a bug (unfortunately in wrong forum, sorry for that), but now I hit the same problem again, with newer version.
Here is the link to my previous post:
viewtopic.php?f=1&t=21314

Now I upgraded to ImageMagick 6.9.2-0 Q16 x86_64 and I got the same problem
The error occurs when there is a colon in the file path and when I'm trying to process only certain page/s from the file

Example that produces an error:

Code: Select all

convert /s:/mypictures/test1.pdf[1] test.jpg
The command works when there is no colon or page modifier:

Code: Select all

convert /s:/mypictures/test1.pdf test.jpg
or

Code: Select all

convert /nocolonpath/test1.pdf[1] test.jpg

Re: Cannot process file page when the file path contains colon

Posted: 2015-10-19T00:10:53-07:00
by fmw42
Does it fail in IM 6.9.2.4 (current release)? Does it fail if you put double quotes about the filename? What is your platform?

Re: Cannot process file page when the file path contains colon

Posted: 2015-10-19T00:26:17-07:00
by tlichev
Sorry for the missing info
My platform is ArchLinux x64
Currently it is not possible for me to upgrade to 6.9.2.4, so I cannot test with it now
Tried with quotes, escaping the colon - no luck
As far as I know the problem exists only on Linux (don't know about other Unix systems ...)

Code: Select all

[user@local]$ convert /tmp/s:/test.pdf[0] test.jpg
convert: unable to open image `/test.pdf': No such file or directory @ error/blob.c/OpenBlob/2695.
convert: no decode delegate for this image format `/TMP/S' @ error/constitute.c/ReadImage/501.
convert: no images defined `test.jpg' @ error/convert.c/ConvertImageCommand/3230.

[user@local]$ convert /tmp/s\:/test.pdf[0] test.jpg
convert: unable to open image `/test.pdf': No such file or directory @ error/blob.c/OpenBlob/2695.
convert: no decode delegate for this image format `/TMP/S' @ error/constitute.c/ReadImage/501.
convert: no images defined `test.jpg' @ error/convert.c/ConvertImageCommand/3230.

[user@local]$ convert "/tmp/s:/test.pdf[0]" test.jpg
convert: unable to open image `/test.pdf': No such file or directory @ error/blob.c/OpenBlob/2695.
convert: no decode delegate for this image format `/TMP/S' @ error/constitute.c/ReadImage/501.
convert: no images defined `test.jpg' @ error/convert.c/ConvertImageCommand/3230.

[user@local]$ convert "/tmp/s:/test.pdf"[0] test.jpg
convert: unable to open image `/test.pdf': No such file or directory @ error/blob.c/OpenBlob/2695.
convert: no decode delegate for this image format `/TMP/S' @ error/constitute.c/ReadImage/501.
convert: no images defined `test.jpg' @ error/convert.c/ConvertImageCommand/3230.

Re: Cannot process file page when the file path contains colon

Posted: 2015-10-19T10:00:15-07:00
by glennrp
It is a feature, not a bug. The part of the filename up to the first colon is a format. Just put a format (pdf:) in your case, at the beginning of the filename:

Code: Select all

convert pdf:/tmp/s:/test.pdf[0] test.jpg
works for me with the current IM running on Ubuntu.

Re: Cannot process file page when the file path contains colon

Posted: 2015-10-19T22:59:50-07:00
by tlichev
Thanks!
I tested on my system and it works this way.
Actually the error message says it, but now I understand :)
But what if I want to leave the format recognition to IM ?
There should be a way to escape/quote the file path. It may contain characters that are internally used by IM for some logic and are allowed symbols for file path. For example what if IM is working with user folders and there is no control over the characters the file path may contain?

Re: Cannot process file page when the file path contains colon

Posted: 2015-10-20T09:40:51-07:00
by glennrp
tlichev wrote: But what if I want to leave the format recognition to IM ?

Code: Select all

convert :/tmp/s:/test.pdf[0] test.jpg
The leading colon in effect escapes the second one, without defining a format.

Re: Cannot process file page when the file path contains colon

Posted: 2015-10-20T23:26:32-07:00
by tlichev
Thanks! It works perfectly now