ImageMagick 6.9.9 HELP!!

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
jmkinggg
Posts: 3
Joined: 2018-02-25T13:04:24-07:00
Authentication code: 1152

ImageMagick 6.9.9 HELP!!

Post by jmkinggg »

Guys,

For the life of me I cannot figure out where to change the output directory of images converted with imagemagick.

I'm basically using automator and this script to change multipage tiffs out to jpegs

for f in "$@"
do
/opt/local/bin/convert '*.*' converted_%04d.jpeg
echo "$f"
done

It's sending the exported images to my user home directory.

So my questions!

Where do I change the directory these are going too? I want to either make a new directory on desktop or change the main output directory.
Should this be put in the script itself? If so what do I add to the script.

Also when running this services on the tiff files sometimes the services stops working randomly and won't run at all. Is there a reason for this? How do I fix this so it will always work? Should automator be setup as an application instead?

Thank you!

Imagemagick 6.9.9
mac osx sierra
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: ImageMagick 6.9.9 HELP!!

Post by fmw42 »

Create a new directory. Then

Code: Select all

for f in "$@"
do
/opt/local/bin/convert '*.*' path2newdirectory/converted_%04d.jpeg 
echo "$f"
done
jmkinggg
Posts: 3
Joined: 2018-02-25T13:04:24-07:00
Authentication code: 1152

Re: ImageMagick 6.9.9 HELP!!

Post by jmkinggg »

Awesome! I've changed that but I'm still having an issue with the script not doing anything now. Is there a cache or something that needs to be cleared? I was working but stopped.
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: ImageMagick 6.9.9 HELP!!

Post by snibgo »

I know nothing about "automator", but what is the purpose of the "f" loop? It is echoed, but not used in the convert command.
snibgo's IM pages: im.snibgo.com
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: ImageMagick 6.9.9 HELP!!

Post by fmw42 »

If you want to process all images in a directory, Then it is easier to use mogrify. See https://www.imagemagick.org/Usage/basics/#mogrify

How did you change your convert command? What path did you use to your new directory?
jmkinggg
Posts: 3
Joined: 2018-02-25T13:04:24-07:00
Authentication code: 1152

Re: ImageMagick 6.9.9 HELP!!

Post by jmkinggg »

Thanks guys. I'm not familiar enough with the bash scripting. I simply want to make an app or service with automator that my office can use to convert multipage tiffs to jpegs and put them in a folder. The script works in terminal if the "*.*" is pointed at a specific file but when its in automator so the user can choose the files then it runs the script, automator just hangs and then the services icon in the top menu bar tops spinning then disappears. It's like right as automator sees the bash script it hangs and disappears. Any ideas would be greatly appreciated or someone else with experience in automator shell scripts or even maybe using an applescript to call the commands from terminal? Thanks!

in automator I'm basically making a service or an app then adding a run shell script and adding the following

/bin/bash
pass input as agruements

for f in "$@"
do
/opt/local/bin/convert '*.*' Users/nestedsales/Desktop/Conversions/converted_%04d.jpeg
echo "$f"
done

if someone wanted to try it themselves, just make a multipage tiff thats about 2.0mb in size or whatever.

Or is there any other suggestions on something that can run these scripts without having to use the terminal directly?
Needs to be very simple for a very basic computer skill person to use. Just select all the files and add them to an app or right click on them and run a service.

Thanks again.
Bonzo
Posts: 2971
Joined: 2006-05-20T08:08:19-07:00
Location: Cambridge, England

Re: ImageMagick 6.9.9 HELP!!

Post by Bonzo »

Not that this is of much direct help with your problem but on Windows I have a batch script on the desktop and I just drag and drop my file onto the icon and it is converted.

Is there a similar option on a mac?
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: ImageMagick 6.9.9 HELP!!

Post by fmw42 »

Perhaps it should be /Users not Users

/opt/local/bin/convert '*.*' /Users/nestedsales/Desktop/Conversions/converted_%04d.jpeg
Post Reply