convert Problems under Windows 7

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
imusr
Posts: 2
Joined: 2012-11-05T01:56:58-07:00
Authentication code: 67789

convert Problems under Windows 7

Post by imusr »

Dear Imagemagick experts,

I've got a problem with the following script under Windows 7

Code: Select all

@echo on
FOR /F %%I IN ('DIR *.jpg /b') DO (convert.exe %%I -resize 800x600 -auto-orient -density 72 -quality 75 c_%%I
composite -watermark 15%% -gravity center c:\imagebatch\pic.png c_%%I c_%%I)
I've start this script with a shell command under the context Menu in my Windows Explorer. I've added this under HKEYLM\SOftware\Classes\Directory\shell\Piccommand\command

-> the Reg ey C:\imagebatch\test.cmd

If you choose a folder with pictures and doing a right click on it, choose piccommand it always display the message file not found

after this I tried to add after the C:\imagebatch\test.cmd %1 and tried to run the script like this

Code: Select all

@echo on
FOR /%%I IN (%1\*.jpg) DO (convert.exe %%I -resize 800x600 -auto-orient -density 72 -quality 75 c_%%I
composite -watermark 15%% -gravity center c:\imagebatch\pic.png c_%%I c_%%I)
Now the script starts in the pointed directory but displays the message "improper parameter - - resize"

If I copy the original Script in the picture folder it works.

Has anyone of you a hint how to solve this Problem.

Greetings

Marc
el_supremo
Posts: 1015
Joined: 2005-03-21T21:16:57-07:00

Re: convert Problems under Windows 7

Post by el_supremo »

Windows might be finding the system "convert.exe" command instead of the one for Imagemagick. Try changing the IM convert.exe to magick.exe and change it in the script as well.

Pete
Sorry, my ISP shutdown all personal webspace so my MagickWand Examples in C is offline.
See my message in this topic for a link to a zip of all the files.
imusr
Posts: 2
Joined: 2012-11-05T01:56:58-07:00
Authentication code: 67789

Re: convert Problems under Windows 7

Post by imusr »

Hey,

windows uses the right convert.exe, if I type "convert" manually in the commandline it works!

greetings

marc
el_supremo
Posts: 1015
Joined: 2005-03-21T21:16:57-07:00

Re: convert Problems under Windows 7

Post by el_supremo »

That doesn't mean that the script is finding the same one. The error message you get about an invalid parameter "-resize" is exactly the message that is produced by the Windows convert program.
Try renaming the IM convert anyway.

Pete
Sorry, my ISP shutdown all personal webspace so my MagickWand Examples in C is offline.
See my message in this topic for a link to a zip of all the files.
Post Reply