Saving via ImageMagick with Coyote Routines fails II [message #78147] |
Tue, 25 October 2011 17:01  |
JP
Messages: 55 Registered: April 2008
|
Member |
|
|
Hi there,
Another problem with PS_Start/PS_End and ImageMagick:
When I try to create a simple plot, ImageMagick reports an error:
IDL> PS_Start, Filename='C:\temp\test.ps'
IDL> cgplot, indgen(100)
IDL> PS_End , /png
I get the following:
PostScript output will be created here: C:\temp\test.ps
ImageMagick CONVERT command: convert -alpha off -density 300 "C:\temp\test.ps" -resize 25% -flatten -rotate 90 "PNG24:C:\temp\test.png"
Magick: `%s' (%d) "gswin32c.exe" -q -dQUIET -dPARANOIDSAFER -dBATCH -dNOPAUSE -dNOPROMPT -dMaxBitmap=500000000 -dEPSCrop -dAlignToPixels=0 -dGridFitTT=2 "-sDEVICE=pngalpha" -dTextAlphaBits=4 -dGraphicsAlphaBits=4 "-r300x300" -g1854x2967 " -sOutputFile=C:/DOCUME~1/gue026/LOCALS~1/Temp/magick-ZY0nvQM 2--0000001 " "-fC:/DOCUME~1/gue026/LOCALS~1/Temp/magick-Uekxe77J" "-fC:/DOCUME~1/gue026/LOCALS~1/Temp/magick-1PbnxUTh" @ error/utility.c/SystemCommand/2094.
Magick: `%s' (%d) "gswin32c.exe" -q -dQUIET -dPARANOIDSAFER -dBATCH -dNOPAUSE -dNOPROMPT -dMaxBitmap=500000000 -dEPSCrop -dAlignToPixels=0 -dGridFitTT=2 "-sDEVICE=pngalpha" -dTextAlphaBits=4 -dGraphicsAlphaBits=4 "-r300x300" -g1854x2967 " -sOutputFile=C:/DOCUME~1/gue026/LOCALS~1/Temp/magick-ZY0nvQM 2--0000001 " "-fC:/DOCUME~1/gue026/LOCALS~1/Temp/magick-Uekxe77J" "-fC:/DOCUME~1/gue026/LOCALS~1/Temp/magick-1PbnxUTh" -c showpage @ error/utility.c/SystemCommand/2094.
Magick: Postscript delegate failed `C:\temp\test.ps': No such file or directory @ error/ps.c/ReadPSImage/806.
Magick: missing an image filename `PNG24:C:\temp\test.png' @ error/convert.c/ConvertImageCommand/3011.
The file C:\temp\test.ps is indeed created but ImageMagick doesn't find it.
I am running the latest version (6.7.3-2), just updated from a previous version but the problem persists .
Any ideas?
Thanks!
JP
|
|
|
|
|
Re: Saving via ImageMagick with Coyote Routines fails II [message #82124 is a reply to message #78147] |
Mon, 19 November 2012 18:03   |
David Fanning
Messages: 11724 Registered: August 2001
|
Senior Member |
|
|
JP writes:
> last time I found this problem with ImageMagick it had to do with
problems in accessing the ps file created by PS_End.
> Now i am getting the same problem EVEN making sure first that there should be no issues in accessing the file:
>
> IDL> new_dir = 'c:\temp2\'
> IDL> FILE_MKDIR, new_dir
> IDL> PS_Start, Filename=new_dir+'test.ps'
> IDL> cgplot, indgen(100)
> IDL> PS_End, /PNG, /showcmd
> PostScript output will be created here: c:\temp2\test.ps
> ImageMagick CONVERT command: convert -alpha off -density 300 "c:\temp2\test.ps" -resize 25% -flatten -rotate 90 "PNG24:c:\temp2\test.png"
> convert.exe: `%s' (%d) "gswin32c.exe" -q -dQUIET -dSAFER -dBATCH -dNOPAUSE -dNOPROMPT -dMaxBitmap=500000000 -dEPSCrop -dAlignToPixels=0 -dGridFitTT=2 "-sDEVICE=pngalpha" -dTextAlphaBits=4 -dGraphicsAlphaBits=4 "-r300x300" -g1854x2967 " -sOutputFile=C:/Users/gue026/AppData/Local/Temp/magick-21287 cMXH7w6TR-P--0000001 " " -fC:/Users/gue026/AppData/Local/Temp/magick-2128CVo693jcaWl_ " " -fC:/Users/gue026/AppData/Local/Temp/magick-2128YYBBa5QlYRnx " @
error/utility.c/SystemCommand/1890.
> convert.exe: `%s' (%d) "gswin32c.exe" -q -dQUIET -dSAFER -dBATCH -dNOPAUSE -dNOPROMPT -dMaxBitmap=500000000 -dEPSCrop -dAlignToPixels=0 -dGridFitTT=2 "-sDEVICE=pngalpha" -dTextAlphaBits=4 -dGraphicsAlphaBits=4 "-r300x300" -g1854x2967 " -sOutputFile=C:/Users/gue026/AppData/Local/Temp/magick-21287 cMXH7w6TR-P--0000001 " " -fC:/Users/gue026/AppData/Local/Temp/magick-2128CVo693jcaWl_ " " -fC:/Users/gue026/AppData/Local/Temp/magick-2128YYBBa5QlYRnx " -c showpage @
error/utility.c/SystemCommand/1890.
> convert.exe: Postscript delegate failed `c:\temp2\test.ps': No such file or directory @ error/ps.c/ReadPSImage/833.
> convert.exe: no images defined `PNG24:c:\temp2\test.png' @ error/convert.c/ConvertImageCommand/3044.
>
>
> the test.ps file is created, but ImageMagick fails to convert it into a PNG.
> tried in different folders and drives and same result.
>
> Windows 7
> and
> IDL> print, cghasimagemagick(version=version) & print, version
> 1
> 6.8.0-4
>
> interestingly i do the same in another computer with ImageMagick 6.7.3-3 and same results.
>
> any ideas?
File permissions? Don't know.
I'd open a Windows command prompt and see if you
can somehow get ImageMagick to work on its own.
It would seem to be installed properly, and the command
from inside of IDL looks right.
Has to be file permissions, I think.
Let us know.
Cheers,
David
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Sepore ma de ni thue. ("Perhaps thou speakest truth.")
|
|
|
|
Re: Saving via ImageMagick with Coyote Routines fails II [message #82187 is a reply to message #78147] |
Tue, 20 November 2012 22:10  |
JP
Messages: 55 Registered: April 2008
|
Member |
|
|
maybe people should read the documentation first? ;)
from PS_End:
If `ImageMagick ` is installed
on your computer, you can easily convert PostScript output to GIF, JPEG, PNG, and TIFF
raster output. If `Ghostscript ` is installed
you can convert PostScript output to PDF files.
from cgPlot:
All raster file output is created through PostScript intermediate files (the
PostScript files will be deleted), so ImageMagick and Ghostview MUST be installed
to produce anything other than PostScript output.
On Wednesday, 21 November 2012 15:13:28 UTC+11, JP wrote:
> BTW, and I already knew about this, ImageMagick doesn't like network paths such as:
>
> \\wron\working\
>
>
>
> it needs to map the network drive first
>
>
>
> David, if you are going to update the user instructions in your scripts it may be worth saying that?
>
>
>
> JP
>
>
>
>
>
> On Wednesday, 21 November 2012 13:08:54 UTC+11, JP wrote:
>
>> Bingo!!
>
>>
>
>>
>
>>
>
>> Yes, that's the problem. Installed Ghostscript and all working now!!
>
>>
>
>>
>
>>
>
>> now I see some people have mentioned this in the ImageMagick forums...
>
>>
>
>>
>
>>
>
>> Thanks!
>
>>
>
>>
>
>>
>
>> JP
>
>>
>
>>
>
>>
>
>>
>
>>
>
>> On Wednesday, 21 November 2012 12:42:46 UTC+11, David Fanning wrote:
>
>>
>
>>> JP writes:
>
>>
>
>>>
>
>>
>
>>>
>
>>
>
>>>
>
>>
>
>>>> it's like convert doesnt like postscript here :(
>
>>
>
>>>
>
>>
>
>>>
>
>>
>
>>>
>
>>
>
>>> Ah! I learned recently that ImageMagick has dependencies on
>
>>
>
>>>
>
>>
>
>>> Ghostscript, which it apparently uses to do some PostScript-type
>
>>
>
>>>
>
>>
>
>>> things. Perhaps this is the problem. Is Ghostscript installed
>
>>
>
>>>
>
>>
>
>>> on that machine?
>
>>
>
>>>
>
>>
>
>>>
>
>>
>
>>>
>
>>
>
>>> I use the Ghostscript and the GSView program (really nice!)
>
>>
>
>>>
>
>>
>
>>> that is found here:
>
>>
>
>>>
>
>>
>
>>>
>
>>
>
>>>
>
>>
>
>>> http://pages.cs.wisc.edu/~ghost/
>
>>
>
>>>
>
>>
>
>>>
>
>>
>
>>>
>
>>
>
>>> Cheers,
>
>>
>
>>>
>
>>
>
>>>
>
>>
>
>>>
>
>>
>
>>> David
>
>>
>
>>>
>
>>
>
>>> --
>
>>
>
>>>
>
>>
>
>>> David Fanning, Ph.D.
>
>>
>
>>>
>
>>
>
>>> Fanning Software Consulting, Inc.
>
>>
>
>>>
>
>>
>
>>> Coyote's Guide to IDL Programming: http://www.dfanning.com/
>
>>
>
>>>
>
>>
>
>>> Sepore ma de ni thue. ("Perhaps thou speakest truth.")
|
|
|
Re: Saving via ImageMagick with Coyote Routines fails II [message #82188 is a reply to message #78147] |
Tue, 20 November 2012 20:13  |
JP
Messages: 55 Registered: April 2008
|
Member |
|
|
BTW, and I already knew about this, ImageMagick doesn't like network paths such as:
\\wron\working\
it needs to map the network drive first
David, if you are going to update the user instructions in your scripts it may be worth saying that?
JP
On Wednesday, 21 November 2012 13:08:54 UTC+11, JP wrote:
> Bingo!!
>
>
>
> Yes, that's the problem. Installed Ghostscript and all working now!!
>
>
>
> now I see some people have mentioned this in the ImageMagick forums...
>
>
>
> Thanks!
>
>
>
> JP
>
>
>
>
>
> On Wednesday, 21 November 2012 12:42:46 UTC+11, David Fanning wrote:
>
>> JP writes:
>
>>
>
>>
>
>>
>
>>> it's like convert doesnt like postscript here :(
>
>>
>
>>
>
>>
>
>> Ah! I learned recently that ImageMagick has dependencies on
>
>>
>
>> Ghostscript, which it apparently uses to do some PostScript-type
>
>>
>
>> things. Perhaps this is the problem. Is Ghostscript installed
>
>>
>
>> on that machine?
>
>>
>
>>
>
>>
>
>> I use the Ghostscript and the GSView program (really nice!)
>
>>
>
>> that is found here:
>
>>
>
>>
>
>>
>
>> http://pages.cs.wisc.edu/~ghost/
>
>>
>
>>
>
>>
>
>> Cheers,
>
>>
>
>>
>
>>
>
>> David
>
>>
>
>> --
>
>>
>
>> David Fanning, Ph.D.
>
>>
>
>> Fanning Software Consulting, Inc.
>
>>
>
>> Coyote's Guide to IDL Programming: http://www.dfanning.com/
>
>>
>
>> Sepore ma de ni thue. ("Perhaps thou speakest truth.")
|
|
|
Re: Saving via ImageMagick with Coyote Routines fails II [message #82192 is a reply to message #78147] |
Tue, 20 November 2012 18:08  |
JP
Messages: 55 Registered: April 2008
|
Member |
|
|
Bingo!!
Yes, that's the problem. Installed Ghostscript and all working now!!
now I see some people have mentioned this in the ImageMagick forums...
Thanks!
JP
On Wednesday, 21 November 2012 12:42:46 UTC+11, David Fanning wrote:
> JP writes:
>
>
>
>> it's like convert doesnt like postscript here :(
>
>
>
> Ah! I learned recently that ImageMagick has dependencies on
>
> Ghostscript, which it apparently uses to do some PostScript-type
>
> things. Perhaps this is the problem. Is Ghostscript installed
>
> on that machine?
>
>
>
> I use the Ghostscript and the GSView program (really nice!)
>
> that is found here:
>
>
>
> http://pages.cs.wisc.edu/~ghost/
>
>
>
> Cheers,
>
>
>
> David
>
> --
>
> David Fanning, Ph.D.
>
> Fanning Software Consulting, Inc.
>
> Coyote's Guide to IDL Programming: http://www.dfanning.com/
>
> Sepore ma de ni thue. ("Perhaps thou speakest truth.")
|
|
|
|
Re: Saving via ImageMagick with Coyote Routines fails II [message #82194 is a reply to message #82122] |
Tue, 20 November 2012 17:32  |
JP
Messages: 55 Registered: April 2008
|
Member |
|
|
Thanks David,
It definetely is a problem of file access by convert, nothing wrong with PS_Start/PS_End whatsoever. But I am trying to understand what is going on and can't understand it. A colleague here tried that bit of code and no problems.
ImageMagick is installed in my machine.
if i manually copy a file called cgWindow.png into c:\new and type in a command prompt:
convert cgWindow.png cgWindow.jpg
it works, no problem. And i get my new file
then i try:
convert cgWindow.png cgWindow.ps
also works, i get a postscript.
However, then i try:
convert cgWindow.ps cgWindow.png
and get a similar error message as when i try it from IDL via PS_End.
it's like convert doesnt like postscript here :(
very frustrating.
JP
On Tuesday, 20 November 2012 13:18:56 UTC+11, David Fanning wrote:
> David Fanning writes:
>
>
>
>> No problems whatsoever. Mismatch between 64-bit OS and
>
>> 32-bit ImageMagick? Really don't know.
>
>
>
> Is ImageMagick installed on this machine, or is it
>
> being acquired over a network?
>
>
>
> David
>
>
>
>
>
> --
>
> David Fanning, Ph.D.
>
> Fanning Software Consulting, Inc.
>
> Coyote's Guide to IDL Programming: http://www.dfanning.com/
>
> Sepore ma de ni thue. ("Perhaps thou speakest truth.")
|
|
|