difference between cmd line & script
difference between cmd line & script
Hi...
I have an awk script that I am trying to use convert in and it fails with the following error...
dyld: Library not loaded: /ImageMagick-6.8.9/lib/libMagickCore-6.Q16.2.dylib
Referenced from: /Users/dennis/Applications/ImageMagick-6.8.9/bin/convert
Reason: image not found
if I copy and paste the offending line on the command line it executes just fine...
Here is part of the awk script...
BEGIN{
FS = "/";
}
{
fileName = $NF;
split (fileName, tmpFileName, ".");
sysCmd = sprintf ( "cp %s __TEMPORARY_FILES__/tmpFile.%s", $0, tmpFileName[2]);
sysCmd = sprintf ( "convert __TEMPORARY_FILES__/tmpFile.%s __TEMPORARY_FILES__/tmpFile.eps", tmpFileName[2]);
system (sysCmd);
print ">>";
print ">> "sysCmd;
print ">>";
}
And the output...
dyld: Library not loaded: /ImageMagick-6.8.9/lib/libMagickCore-6.Q16.2.dylib
Referenced from: /Users/dennis/Applications/ImageMagick-6.8.9/bin/convert
Reason: image not found
>>
>> convert __TEMPORARY_FILES__/tmpFile.pgm __TEMPORARY_FILES__/tmpFile.eps
>>
Thanks for every and anyone's help in advance.
I have an awk script that I am trying to use convert in and it fails with the following error...
dyld: Library not loaded: /ImageMagick-6.8.9/lib/libMagickCore-6.Q16.2.dylib
Referenced from: /Users/dennis/Applications/ImageMagick-6.8.9/bin/convert
Reason: image not found
if I copy and paste the offending line on the command line it executes just fine...
Here is part of the awk script...
BEGIN{
FS = "/";
}
{
fileName = $NF;
split (fileName, tmpFileName, ".");
sysCmd = sprintf ( "cp %s __TEMPORARY_FILES__/tmpFile.%s", $0, tmpFileName[2]);
sysCmd = sprintf ( "convert __TEMPORARY_FILES__/tmpFile.%s __TEMPORARY_FILES__/tmpFile.eps", tmpFileName[2]);
system (sysCmd);
print ">>";
print ">> "sysCmd;
print ">>";
}
And the output...
dyld: Library not loaded: /ImageMagick-6.8.9/lib/libMagickCore-6.Q16.2.dylib
Referenced from: /Users/dennis/Applications/ImageMagick-6.8.9/bin/convert
Reason: image not found
>>
>> convert __TEMPORARY_FILES__/tmpFile.pgm __TEMPORARY_FILES__/tmpFile.eps
>>
Thanks for every and anyone's help in advance.
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: difference between cmd line & script
try using the full path to convert and to your images
Re: difference between cmd line & script
just tried it and its still a problem. Output bellow...
dyld: Library not loaded: /ImageMagick-6.8.9/lib/libMagickCore-6.Q16.2.dylib
Referenced from: /Users/dennis/Applications/ImageMagick-6.8.9/bin/convert
Reason: image not found
>>
>> /Users/dennis/Applications/ImageMagick-6.8.9/bin/convert __TEMPORARY_FILES__/tmpFile.pgm __TEMPORARY_FILES__/tmpFile.eps
>>
dyld: Library not loaded: /ImageMagick-6.8.9/lib/libMagickCore-6.Q16.2.dylib
Referenced from: /Users/dennis/Applications/ImageMagick-6.8.9/bin/convert
Reason: image not found
>>
>> /Users/dennis/Applications/ImageMagick-6.8.9/bin/convert __TEMPORARY_FILES__/tmpFile.pgm __TEMPORARY_FILES__/tmpFile.eps
>>
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: difference between cmd line & script
Can you run your IM command in a terminal without error (outside of AWK)?
Are you sure that is the path to convert? What do you get from
or
What do you get from
What is your platform?
Are you sure that is the path to convert? What do you get from
Code: Select all
type -a convert
Code: Select all
which convert
Code: Select all
convert -version
What is your platform?
Re: difference between cmd line & script
Yes... I can run my IM command (convert) in a terminal without any errors outside of AWK. Works very nicely
here is the answers to your questions...
type -a convert
convert is /Users/dennis/Applications/ImageMagick-6.8.9/bin/convert
which convert
/Users/dennis/Applications/ImageMagick-6.8.9/bin/convert
convert -version
Version: ImageMagick 6.8.9-3 Q16 x86_64 2014-06-17 http://www.imagemagick.org
Copyright: Copyright (C) 1999-2014 ImageMagick Studio LLC
Features: DPC
Delegates: bzlib jng jpeg lcms png tiff xml zlib
I am using the Mac version, and I'm running OSX 10.12.2
here is the answers to your questions...
type -a convert
convert is /Users/dennis/Applications/ImageMagick-6.8.9/bin/convert
which convert
/Users/dennis/Applications/ImageMagick-6.8.9/bin/convert
convert -version
Version: ImageMagick 6.8.9-3 Q16 x86_64 2014-06-17 http://www.imagemagick.org
Copyright: Copyright (C) 1999-2014 ImageMagick Studio LLC
Features: DPC
Delegates: bzlib jng jpeg lcms png tiff xml zlib
I am using the Mac version, and I'm running OSX 10.12.2
Re: difference between cmd line & script
I simplified the problem to a two line script...
A script of the following fails with the errors listed above.
#!/bin/sh
convert tmpFile.pgm tmpFile.eps
but "convert tmpFile.pgm tmpFile.eps" on the command line works.
A script of the following fails with the errors listed above.
#!/bin/sh
convert tmpFile.pgm tmpFile.eps
but "convert tmpFile.pgm tmpFile.eps" on the command line works.
-
- Posts: 12159
- Joined: 2010-01-23T23:01:33-07:00
- Authentication code: 1151
- Location: England, UK
Re: difference between cmd line & script
Does the script run under the same username, with all the same privileges and environment variables as the interactive user?
snibgo's IM pages: im.snibgo.com
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: difference between cmd line & script
try
Do you have the path to IM in your PATH environmental variable?
Code: Select all
#!/bin/bash
/Users/dennis/Applications/ImageMagick-6.8.9/bin/convert/convert tmpFile.pgm tmpFile.eps
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: difference between cmd line & script
You have no delegates for eps. You probably need ghostscript (and if you have text, then freetype, fontconfig ?)Delegates: bzlib jng jpeg lcms png tiff xml zlib
How did you install IM for you Mac? If from source, then you need to install relevant delegates first. If from binary, then the delegates should be there.
I would recommend installing a binary from MacPorts (or Homebrew).
I install all my delegates from MacPorts and then install IM from source. See viewtopic.php?f=1&t=21502&p=88202&hilit ... rts#p88202
Re: difference between cmd line & script
figured it out kids...
its all about... export DYLD_LIBRARY_PATH="$MAGICK_HOME/lib/"
it exists in my .bash_profile so anything I do on the command line it works. Anything I execute in a script (with #!/bin/bash or with awk), the system bash profile has the line missing. If I add the above line to my script it works.
its all about... export DYLD_LIBRARY_PATH="$MAGICK_HOME/lib/"
it exists in my .bash_profile so anything I do on the command line it works. Anything I execute in a script (with #!/bin/bash or with awk), the system bash profile has the line missing. If I add the above line to my script it works.