Newbie Problem - Can't get convert past the file name

ImageMagickObject is a Windows COM+ interface to ImageMagick. COM+, Visual Basic, and Delphi users should post to this discussion group.
Post Reply
Steve
Posts: 2
Joined: 2014-04-12T06:11:20-07:00
Authentication code: 6789

Newbie Problem - Can't get convert past the file name

Post by Steve »

I'm setting up ImageMagick to distort some images using the Polynomial function. I've got ImageMagick installed and the convert function appears to be working (so it's apparently something other than the convert name problem). When I try to run convert using a single filename it assumes that the backslash following the filename is another filename, and can't find it. Here's the command I'm submitting:
convert "D:\Users\Steve\Pictures\Figures\Hopi\FordeHorizonCalendarWalpi.tif" \
-distort Polynomial \
"2
262, 0 314, 0
341, 0 352, 0
798, 0 724, 0
952, 0 910, 0
1302, 0 1357, 0
1433, 0 1431, 0
262, 250 314, 250
341, 250 352, 250
798, 250 724, 250
952, 250 910, 250
1302, 250 1357, 250
1433, 250 1431, 250
262, 500 314, 500
341, 500 352, 500
798, 500 724, 500
952, 500 910, 500
1302, 500 1357, 500
1433, 500 1431, 500" \
"D:\Users\Steve\Pictures\Figures\Hopi\FordeHorizonCalendarWalpiDPoly2.tif"
and here's the error message I receive:
D:\Users\Steve>convert "D:\Users\Steve\Pictures\Figures\Hopi\FordeHorizonCalenda
rWalpi.tif" \
convert.exe: unable to open image `\': No such file or directory @ error/blob.c/
OpenBlob/2645.

D:\Users\Steve>-distort Polynomial \
'-distort' is not recognized as an internal or external command,
operable program or batch file.

D:\Users\Steve>"2
'"2' is not recognized as an internal or external command,
operable program or batch file.

D:\Users\Steve>262, 0 314, 0
'262' is not recognized as an internal or external command,
operable program or batch file.

D:\Users\Steve>341, 0 352, 0
'341' is not recognized as an internal or external command,
operable program or batch file.

...

D:\Users\Steve>1302, 500 1357, 500
'1302' is not recognized as an internal or external command,
operable program or batch file.

D:\Users\Steve>1433, 500 1431, 500" \
'1433' is not recognized as an internal or external command,
operable program or batch file.

D:\Users\Steve>"D:\Users\Steve\Pictures\Figures\Hopi\FordeHorizonCalendarWalpiDP
oly2.tif"
'"D:\Users\Steve\Pictures\Figures\Hopi\FordeHorizonCalendarWalpiDPoly2.tif"' is
not recognized as an internal or external command,
operable program or batch file.

D:\Users\Steve>
I first thought it might have been a filename length issue, but had the same problem using the shorter relative filename.

I suspect the error message "error/blob.c/
OpenBlob/2645" is meant to tell me something. Any insights would be welcome.

Steve
Werty
Posts: 66
Joined: 2010-08-06T05:37:36-07:00
Authentication code: 8675308

Re: Newbie Problem - Can't get convert past the file name

Post by Werty »

Since you post this in the windows COM+ section of the forum I assume you are running windows, but are using Unix commands.

Most examples are written for Unix which you need to convert to DOS commands (which is easy), leave out the backslashes and use the DOS line continuation instead.

Read about it here...
http://www.imagemagick.org/Usage/windows/#dos
Windows 7 user
Steve
Posts: 2
Joined: 2014-04-12T06:11:20-07:00
Authentication code: 6789

Re: Newbie Problem - Can't get convert past the file name

Post by Steve »

Thanks for the helpful link; it cleared up the difference between UNIX and Windows syntax.

I still have problems getting it to read the output filename but I'll work on it for a while.

Steve
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: Newbie Problem - Can't get convert past the file name

Post by snibgo »

I'll use a smaller example:

Code: Select all

convert -size 200x200 gradient: -distort polynomial ^
  "1.5   0,0 26,0  128,0 114,23   128,128 128,100   0,128 0,123 " ^
  out0.png
The Windows command interpreter doesn't like strings split across lines. But the arguments to -distort polynomial don't need to be a string, provided no spaces separate the numbers.

Code: Select all

%IM%convert -size 200x200 gradient: -distort polynomial ^
  1.5,^
0,0,26,0,^
128,0,114,23,^
128,128,128,100,^
0,128,0,123 ^
  out1.png
Or you can use an "at" file, thus:

Code: Select all

%IM%convert -size 200x200 gradient: -distort polynomial @poly.txt out3.png
... where poly.txt has any number of spaces, eg:

Code: Select all

1.5
0,0     26,0
128,0   114,23
128,128 128,100
0,128   0,123
snibgo's IM pages: im.snibgo.com
Post Reply