comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Problem creating .png file using Coyote graphics (or maybe problem with cgHasImageMagick?)
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
Problem creating .png file using Coyote graphics (or maybe problem with cgHasImageMagick?) [message #94563] Sat, 08 July 2017 13:25 Go to next message
BLesht is currently offline  BLesht
Messages: 89
Registered: March 2007
Member
I've been trying to track down a problem I've encountered when attempting to output a graphics file (png) using the Coyote graphics cgControl procedure. I've done this many times in the past without problems, but now have updated to IDL8.6 as well as to MacOS10.12.5 and what used to work no longer does.

The problem seems simple. I generate a plot in a Coyote graphics window. I can use the "Save Window As" feature from the window File menu and successfully create a .png file. When I do this, I get the expected command window message "Output will be created here:" However, when I try to do the same thing from within the plotting procedure using the cgControl, /PS_DECOMPOSED, OUTPUT='~filname.png' command, nothing happens - no confirming message, no .png file.

I thought there might be a problem with ImageMagick so I tried cgHasImageMagick and got

IDL> cgHasImageMagick(VERSION=whatVersion)
1
IDL> whatVersion
% Attempt to call undefined procedure: 'WHATVERSION'.
% Execution halted at: $MAIN$

which seems strange.

When I try invoking convert directly using SPAWN, I get

IDL> spawn, 'convert -version', thisVersion, err_code
IDL> thisVersion
Version: ImageMagick 6.9.8-10 Q16 x86_64 2017-07-08 http://www.imagemagick.org
Copyright: © 1999-2017 ImageMagick Studio LLC
License: http://www.imagemagick.org/script/license.php
Features: Cipher DPC Modules
Delegates (built-in): bzlib djvu fftw fontconfig freetype gslib jbig jng jp2 jpeg lcms ltdl lzma openexr png ps tiff webp x xml zlib

which looks fine.

I'm wondering if anyone else has had a similar problem and if so, how they fixed it. Now that David is retired I'm hoping someone else might be able to help.

Thanks.
Re: Problem creating .png file using Coyote graphics (or maybe problem with cgHasImageMagick?) [message #94564 is a reply to message #94563] Sat, 08 July 2017 19:09 Go to previous messageGo to next message
Jim  Pendleton is currently offline  Jim Pendleton
Messages: 165
Registered: November 2011
Senior Member
On Saturday, July 8, 2017 at 2:25:49 PM UTC-6, Barry Lesht wrote:
> I've been trying to track down a problem I've encountered when attempting to output a graphics file (png) using the Coyote graphics cgControl procedure. I've done this many times in the past without problems, but now have updated to IDL8.6 as well as to MacOS10.12.5 and what used to work no longer does.
>
> The problem seems simple. I generate a plot in a Coyote graphics window. I can use the "Save Window As" feature from the window File menu and successfully create a .png file. When I do this, I get the expected command window message "Output will be created here:" However, when I try to do the same thing from within the plotting procedure using the cgControl, /PS_DECOMPOSED, OUTPUT='~filname.png' command, nothing happens - no confirming message, no .png file.
>
> I thought there might be a problem with ImageMagick so I tried cgHasImageMagick and got
>
> IDL> cgHasImageMagick(VERSION=whatVersion)
> 1
> IDL> whatVersion
> % Attempt to call undefined procedure: 'WHATVERSION'.
> % Execution halted at: $MAIN$
>
> which seems strange.
>
> When I try invoking convert directly using SPAWN, I get
>
> IDL> spawn, 'convert -version', thisVersion, err_code
> IDL> thisVersion
> Version: ImageMagick 6.9.8-10 Q16 x86_64 2017-07-08 http://www.imagemagick.org
> Copyright: © 1999-2017 ImageMagick Studio LLC
> License: http://www.imagemagick.org/script/license.php
> Features: Cipher DPC Modules
> Delegates (built-in): bzlib djvu fftw fontconfig freetype gslib jbig jng jp2 jpeg lcms ltdl lzma openexr png ps tiff webp x xml zlib
>
> which looks fine.
>
> I'm wondering if anyone else has had a similar problem and if so, how they fixed it. Now that David is retired I'm hoping someone else might be able to help.
>
> Thanks.

The source code for cghasimagemagick is here:
http://www.idlcoyote.com/programs/cghasimagemagick.pro

If !os.version is "DARWIN", you won't get a version number back. Coyote can be like that. Maybe the output from ImageMagick has been changed in its latest version to appease him.

As far as the other aberrant behavior, you might need to step through the code.

Jim P.
Re: Problem creating .png file using Coyote graphics (or maybe problem with cgHasImageMagick?) [message #94565 is a reply to message #94564] Sun, 09 July 2017 07:58 Go to previous message
BLesht is currently offline  BLesht
Messages: 89
Registered: March 2007
Member
On Saturday, July 8, 2017 at 9:09:43 PM UTC-5, Jim P wrote:
> On Saturday, July 8, 2017 at 2:25:49 PM UTC-6, Barry Lesht wrote:
>> I've been trying to track down a problem I've encountered when attempting to output a graphics file (png) using the Coyote graphics cgControl procedure. I've done this many times in the past without problems, but now have updated to IDL8.6 as well as to MacOS10.12.5 and what used to work no longer does.
>>
>> The problem seems simple. I generate a plot in a Coyote graphics window. I can use the "Save Window As" feature from the window File menu and successfully create a .png file. When I do this, I get the expected command window message "Output will be created here:" However, when I try to do the same thing from within the plotting procedure using the cgControl, /PS_DECOMPOSED, OUTPUT='~filname.png' command, nothing happens - no confirming message, no .png file.
>>
>> I thought there might be a problem with ImageMagick so I tried cgHasImageMagick and got
>>
>> IDL> cgHasImageMagick(VERSION=whatVersion)
>> 1
>> IDL> whatVersion
>> % Attempt to call undefined procedure: 'WHATVERSION'.
>> % Execution halted at: $MAIN$
>>
>> which seems strange.
>>
>> When I try invoking convert directly using SPAWN, I get
>>
>> IDL> spawn, 'convert -version', thisVersion, err_code
>> IDL> thisVersion
>> Version: ImageMagick 6.9.8-10 Q16 x86_64 2017-07-08 http://www.imagemagick.org
>> Copyright: © 1999-2017 ImageMagick Studio LLC
>> License: http://www.imagemagick.org/script/license.php
>> Features: Cipher DPC Modules
>> Delegates (built-in): bzlib djvu fftw fontconfig freetype gslib jbig jng jp2 jpeg lcms ltdl lzma openexr png ps tiff webp x xml zlib
>>
>> which looks fine.
>>
>> I'm wondering if anyone else has had a similar problem and if so, how they fixed it. Now that David is retired I'm hoping someone else might be able to help.
>>
>> Thanks.
>
> The source code for cghasimagemagick is here:
> http://www.idlcoyote.com/programs/cghasimagemagick.pro
>
> If !os.version is "DARWIN", you won't get a version number back. Coyote can be like that. Maybe the output from ImageMagick has been changed in its latest version to appease him.
>
> As far as the other aberrant behavior, you might need to step through the code.
>
> Jim P.

Hi Jim - thanks. I did look at the cgHasImageMagick source when I was checking this myself. I guess I don't really understand purpose (maybe to deal with the Mac not returning an error_result in the spawned convert command???) of the ARG_PRESENT function and was confused because the Mac clearly does return the version number as part of the 'result' string. I think the important point, however, is that it appears IDL does find ImageMagick and should be able to use it. Begin able to report the version number is secondary.

As for the motivating problem, I guess I'll have to go through cgps2raster and see if anything untoward is happening there.
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Class inheritance with CREATE_STRUCT?
Next Topic: Each time access different part of an array

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Wed Oct 08 07:14:53 PDT 2025

Total time taken to generate the page: 0.00378 seconds