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?".
I'm trying to build a powershell script to resize all photos in a directory including the sub-directory. It appears to work, but it doesn't seem to want to open the photos. I've researched the error codes but most of them are for batch files or other command languages I'm not familiar with.
I suspect it is in your powershell and not Imagemagick. I do not think those codes are Imagemagick codes. Try running your mogrify command in a terminal window outside your powershell. If that works, then the issue is your powershell script.
Often when running a script, it does not know where to find Imagemagick. Try putting the full path to mogrify. Does that work?
In the future please always provide your IM version and platform, though I see you are on Windows.
I tried the full path to mogrify and it still threw the same error but I figured out why it was throwing it. I needed to provide Powershell.exe -Command first. Anyway, the folder I'm pointed to contains nothing but png files and a sub-folder holding more png files.. The code now looks like this:
It still follows through but doesn't print anything, but that line typed into powershell works fine. So I guess its something with my syntax and not imagemagick.
Are you sure you are changing directories to the directory that contains the png images. If you are not in the correct directory, mogrify will not have any png images to process.
I also recommend that you backup your images or use -path with mogrify to some existing empty directory where the output results should be placed.
Also note that mogrify does not traverse subdirectories.
Yes. I don't know Powershell, but I think the command shown loops through directories but then does a dir or mogrify in the original directory, because there is no reference in the command to a loop variable.