[FIXED] Spaces in Paths

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
User avatar
anthony
Posts: 8883
Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia

Re: [FIXED] Spaces in Paths

Post by anthony »

Try adding extra quotes around the file path. For PHP on windows that can be tricky as you much use double quotes.
Something like...

Code: Select all

exec("C:/ImageMagick/convert.exe \"$filename\" thumbnail 250x250 \"$thumbdir/$name.jpg\"" );
The extra quotes are for the dos command parser (or is it cgiwin?)
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
whoisgregg

Re: [FIXED] Spaces in Paths

Post by whoisgregg »

I typically wrap file paths with the PHP function escapeshellarg(). That function does the appropriate escaping for whatever system you run it on (Win/*NIX) so it also makes your script more portable. :)
Post Reply