Imagemagick ftp and spaces

375 Views Asked by At

Imagemagick provides the identify tool, which works perfectly for what I need. I use it on Ubuntu, with Version: ImageMagick 6.9.7-4 Q16 x86_64 20170114.

Here is how I use it:

$ identify "ftp://SERVERNAME:PASSWORD@HOST/DIRECTORY/FILE.pdf"

But when the directory or file has got a space in the name, I get an error as if it doesn't find the file.

Any solution?

NOTE: I've tried with \, \\, %20 or ^ before spaces, but it doesn't solve this issue.

Error : "identify-im6.q16: no decode delegate for this image format `' @ error/constitute.c/ReadImage/504. no data returned"

(same message as if I didn't write the correct name of the file).

1

There are 1 best solutions below

1
On

Your issue could be because you're using double quotes. Try using single quotes instead around the URL to the FTP server. For example, here I'm using the free FTP service mentioned in this other SO Q&A titled: Is there a Public FTP server to test upload and download?.

$ identify 'ftp://demo:[email protected]/pub/example/WinFormClient.png'
ftp://demo:[email protected]/pub/example/WinFormClient.png=>WinFormClient.png PNG 800x700 800x700+0+0 8-bit sRGB 80000B 0.000u 0:00.000

I was able to find another site that allows you to upload files, https://dlptest.com/ftp-test/. In using this, I believe this replicates your issue:

$ identify 'ftp://dlpuser%40dlptest.com:[email protected]/download with space.jpeg'
identify: no decode delegate for this image format `' @ error/constitute.c/ReadImage/512.
identify: no data returned `ftp://dlpuser%40dlptest.com:[email protected]/download with space.jpeg' @ error/url.c/ReadURLImage/246.

This looks like a bug with Imagemagick's handling of URLs. This is the version that I'm using:

$ identify --version
Version: ImageMagick 7.0.8-0 Q16 x86_64 2018-06-13 https://www.imagemagick.org
Copyright: © 1999-2018 ImageMagick Studio LLC
License: https://www.imagemagick.org/script/license.php
Features: Cipher DPC HDRI Modules
Delegates (built-in): bzlib freetype jng jpeg ltdl lzma png tiff xml zlib

At any rate I see you've asked in the Imagemagick forums about this issue - Identify ftp and spaces.