-1

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).

slm
  • 15,396
  • 12
  • 109
  • 124
Daisybodo
  • 1
  • 2
  • What's the exact error message and have you tried to [url-escape the spaces](https://www.w3schools.com/tags/ref_urlencode.asp) using %20? – Gamification Aug 31 '18 at 10:06
  • Same problem with %20. In French : identify-im6.q16: pas de délégué pour décoder ce format d'image `' @ error/constitute.c/ReadImage/504. same message as if I don't write correctly the name of the file – Daisybodo Aug 31 '18 at 10:08
  • Ok. Just a hint, you can run any command in english by putting LANG=C to the beginning; e.g. `LANG=C date` – Gamification Aug 31 '18 at 10:18

1 Answers1

0

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:password@test.rebex.net/pub/example/WinFormClient.png'
ftp://demo:password@test.rebex.net/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:e73jzTRTNqCN9PYAAjjn@ftp.dlptest.com/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:e73jzTRTNqCN9PYAAjjn@ftp.dlptest.com/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.

slm
  • 15,396
  • 12
  • 109
  • 124