Re: LZW in IDL [message #39715] |
Thu, 10 June 2004 06:04 |
Haje Korth
Messages: 651 Registered: May 1997
|
Senior Member |
|
|
Andrew,
this will only check whether the dlm is present, but not whether it is
properly licensed. IMHO, you either have to parse the license file for
idl_tifflzw or use the LMGR routine.
Cheers,
Haje
"Andrew Cool" <andrew.cool@dsto.defence.gov.au> wrote in message
news:c6d70400.0406092052.5b0b8ed6@posting.google.com...
> Jonathan Joseph <jj21@cornell.edu> wrote in message
news:<ca7qcv$8bl$1@news01.cit.cornell.edu>...
>> Is there a way to query whether or not you have permission to write an
>> LZW compressed tiff file?
>>
>> I just found out that we actually do have the LZW licensing string in
>> the license.dat file. Unfortunately, It seems as though the number of
>> allowable LZW licenses is 1, while the number of allowable IDL licenses
>> is 8 - so if someone else has started IDL before you, they have the one
>> and only LZW license. I hope this was just a glitch in the creation of
>> the license.dat file. Another multi-user license we have seems to have
>> the same number of LZW licenses as IDL licenses.
>>
>> Regardless of whether I get our licensing working correctly, I would
>> like to be able to write the code so that it uses LZW if availalbe and
>> either no compression or packbits otherwise. Is there any way to query
>> whether the write_tiff command with compress=1 will work before calling
>> it? Currently, if LZW licensing is not available, the program will halt
>> at the write_tiff call (despite something I read on an RSI web page
>> which claimed that it would default to packbits).
>>
>> For example, if I send the code to collaborators, I want it to not crash
>> if they don't have LZW licensing. Even when the Unysis patents expire,
>> It will take some IDL maintenamce (at least a new license string, if not
>> a new version of IDL) to be able to use the functionality again.
>>
>> Thanks.
>>
>> -Jonathan
>
> Jonathon,
>
> Try issuing the command Help,/DLM,OUT=a
> This will return a list of all the DLMs that IDL knows about, even if
> they haven't been loaded in that session yet.
>
> IDL> help,/dlm,out=a
> IDL> gif=where(strmid(a,0,6) EQ '** GIF')
> IDL> print,a(gif)
> ** GIF - IDL GIF support (not loaded)
>
> If GIF reurns as -1, then you ain't got GIF available
>
> Cheers,
>
> Andrew
> DSTO, Adelaide, South Australia
|
|
|
Re: LZW in IDL [message #39716 is a reply to message #39715] |
Thu, 10 June 2004 06:02  |
Haje Korth
Messages: 651 Registered: May 1997
|
Senior Member |
|
|
Jonathan,
have you tried whether TIFFSupport = LMGR('idl_tifflzw', VERSION='1.0')
works? This stuff is largely undocumented, but RSI uses it for example in
query_image to check for gif support.
Cheers,
Haje
"Jonathan Joseph" <jj21@cornell.edu> wrote in message
news:ca7qcv$8bl$1@news01.cit.cornell.edu...
>
> Is there a way to query whether or not you have permission to write an
> LZW compressed tiff file?
>
> I just found out that we actually do have the LZW licensing string in
> the license.dat file. Unfortunately, It seems as though the number of
> allowable LZW licenses is 1, while the number of allowable IDL licenses
> is 8 - so if someone else has started IDL before you, they have the one
> and only LZW license. I hope this was just a glitch in the creation of
> the license.dat file. Another multi-user license we have seems to have
> the same number of LZW licenses as IDL licenses.
>
> Regardless of whether I get our licensing working correctly, I would
> like to be able to write the code so that it uses LZW if availalbe and
> either no compression or packbits otherwise. Is there any way to query
> whether the write_tiff command with compress=1 will work before calling
> it? Currently, if LZW licensing is not available, the program will halt
> at the write_tiff call (despite something I read on an RSI web page
> which claimed that it would default to packbits).
>
> For example, if I send the code to collaborators, I want it to not crash
> if they don't have LZW licensing. Even when the Unysis patents expire,
> It will take some IDL maintenamce (at least a new license string, if not
> a new version of IDL) to be able to use the functionality again.
>
> Thanks.
>
> -Jonathan
|
|
|
Re: LZW in IDL [message #39720 is a reply to message #39716] |
Wed, 09 June 2004 23:17  |
Mark Hadfield
Messages: 783 Registered: May 1995
|
Senior Member |
|
|
Andrew Cool wrote:
> Jonathan Joseph <jj21@cornell.edu> wrote in message news:<ca7qcv$8bl$1@news01.cit.cornell.edu>...
>
>> Is there a way to query whether or not you have permission to write an
>> LZW compressed tiff file?
>
> Try issuing the command Help,/DLM,OUT=a
> This will return a list of all the DLMs that IDL knows about, even if
> they haven't been loaded in that session yet.
>
> IDL> help,/dlm,out=a
> IDL> gif=where(strmid(a,0,6) EQ '** GIF')
> IDL> print,a(gif)
> ** GIF - IDL GIF support (not loaded)
>
> If GIF reurns as -1, then you ain't got GIF available
That reminds me--I wrote some code to solve a similar problem, ie
determining if the AVI DLM is loaded. I spent a bit of time making it as
fast & robust as possible. See below
--
Mark Hadfield "Ka puwaha te tai nei, Hoea tatou"
m.hadfield@niwa.co.nz
National Institute for Water and Atmospheric Research (NIWA)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
function MGH_HAS_AVI
compile_opt DEFINT32
compile_opt STRICTARR
compile_opt STRICTARRSUBS
common mgh_has_avi_common, has_avi
;; Detect the DLM by parsing out from HELP. DLMs are normally
;; registered when an IDL session is initialised, so this test is
;; done only on the first call..
if n_elements(has_avi) eq 0 then begin
help, /DLM, OUT=info
has_avi = max(strmatch(temporary(info), '\*\* IDL_AVI *')) gt 0
endif
return, has_avi
end
|
|
|
Re: LZW in IDL [message #39721 is a reply to message #39720] |
Wed, 09 June 2004 21:52  |
andrew.cool
Messages: 47 Registered: July 2003
|
Member |
|
|
Jonathan Joseph <jj21@cornell.edu> wrote in message news:<ca7qcv$8bl$1@news01.cit.cornell.edu>...
> Is there a way to query whether or not you have permission to write an
> LZW compressed tiff file?
>
> I just found out that we actually do have the LZW licensing string in
> the license.dat file. Unfortunately, It seems as though the number of
> allowable LZW licenses is 1, while the number of allowable IDL licenses
> is 8 - so if someone else has started IDL before you, they have the one
> and only LZW license. I hope this was just a glitch in the creation of
> the license.dat file. Another multi-user license we have seems to have
> the same number of LZW licenses as IDL licenses.
>
> Regardless of whether I get our licensing working correctly, I would
> like to be able to write the code so that it uses LZW if availalbe and
> either no compression or packbits otherwise. Is there any way to query
> whether the write_tiff command with compress=1 will work before calling
> it? Currently, if LZW licensing is not available, the program will halt
> at the write_tiff call (despite something I read on an RSI web page
> which claimed that it would default to packbits).
>
> For example, if I send the code to collaborators, I want it to not crash
> if they don't have LZW licensing. Even when the Unysis patents expire,
> It will take some IDL maintenamce (at least a new license string, if not
> a new version of IDL) to be able to use the functionality again.
>
> Thanks.
>
> -Jonathan
Jonathon,
Try issuing the command Help,/DLM,OUT=a
This will return a list of all the DLMs that IDL knows about, even if
they haven't been loaded in that session yet.
IDL> help,/dlm,out=a
IDL> gif=where(strmid(a,0,6) EQ '** GIF')
IDL> print,a(gif)
** GIF - IDL GIF support (not loaded)
If GIF reurns as -1, then you ain't got GIF available
Cheers,
Andrew
DSTO, Adelaide, South Australia
|
|
|
Re: LZW in IDL [message #39722 is a reply to message #39721] |
Wed, 09 June 2004 16:52  |
Mark Hadfield
Messages: 783 Registered: May 1995
|
Senior Member |
|
|
Jonathan Joseph wrote:
>
> Regardless of whether I get our licensing working correctly, I would
> like to be able to write the code so that it uses LZW if availalbe and
> either no compression or packbits otherwise. Is there any way to query
> whether the write_tiff command with compress=1 will work before calling
> it? Currently, if LZW licensing is not available, the program will halt
> at the write_tiff call (despite something I read on an RSI web page
> which claimed that it would default to packbits).
When I first read this thread, I thought "Why not just use Zip
compression?" It's as effective, compression-wise, as LZW, and widely
supported. But not supported by IDL apparently, at least not according
to the documentation. This is a shame. Time for a feature request?
You can always post-process the images with ImageMagick, which does
support Zip compression.
--
Mark Hadfield "Ka puwaha te tai nei, Hoea tatou"
m.hadfield@niwa.co.nz
National Institute for Water and Atmospheric Research (NIWA)
|
|
|
Re: LZW in IDL [message #39731 is a reply to message #39722] |
Wed, 09 June 2004 13:11  |
David Fanning
Messages: 11724 Registered: August 2001
|
Senior Member |
|
|
Jonathan Joseph writes:
> Is there any way to query
> whether the write_tiff command with compress=1 will work before calling
> it? Currently, if LZW licensing is not available, the program will halt
> at the write_tiff call (despite something I read on an RSI web page
> which claimed that it would default to packbits).
This might be a good time to learn what CATCH error handling
is all about. :-)
Cheers,
David
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
|
|
|
Re: LZW in IDL [message #39733 is a reply to message #39731] |
Wed, 09 June 2004 13:01  |
Jonathan Joseph
Messages: 69 Registered: September 1998
|
Member |
|
|
Is there a way to query whether or not you have permission to write an
LZW compressed tiff file?
I just found out that we actually do have the LZW licensing string in
the license.dat file. Unfortunately, It seems as though the number of
allowable LZW licenses is 1, while the number of allowable IDL licenses
is 8 - so if someone else has started IDL before you, they have the one
and only LZW license. I hope this was just a glitch in the creation of
the license.dat file. Another multi-user license we have seems to have
the same number of LZW licenses as IDL licenses.
Regardless of whether I get our licensing working correctly, I would
like to be able to write the code so that it uses LZW if availalbe and
either no compression or packbits otherwise. Is there any way to query
whether the write_tiff command with compress=1 will work before calling
it? Currently, if LZW licensing is not available, the program will halt
at the write_tiff call (despite something I read on an RSI web page
which claimed that it would default to packbits).
For example, if I send the code to collaborators, I want it to not crash
if they don't have LZW licensing. Even when the Unysis patents expire,
It will take some IDL maintenamce (at least a new license string, if not
a new version of IDL) to be able to use the functionality again.
Thanks.
-Jonathan
|
|
|
Re: LZW in IDL [message #39745 is a reply to message #39733] |
Wed, 09 June 2004 11:15  |
Haje Korth
Messages: 651 Registered: May 1997
|
Senior Member |
|
|
Don't bother with the waiver, just wait. :-)
Cheers,
Haje
"Jonathan Joseph" <jj21@cornell.edu> wrote in message
news:ca7ilv$553$1@news01.cit.cornell.edu...
>
> While checking in on the whole LZW issue recently, I read the following
> on an RSI website (http://www.rsinc.com/services/techtip.asp?ttid=3543)
>
> "The LZW compression patent held by Unisys, which is the basis for their
> claims surrounding the GIF file format, expired in the U.S. on June 20,
> 2003, however Unisys� patents in Japan, and Europe expire June 20, 2004,
> and expire in Canada on July 7, 2004."
>
> With the last of these patents expiring this summer, can we look forward
> to using LZW encoding again in the next release of IDL, or is that a
> pipe-dream? I don't have much dezire to create GIF images, but I do
> create TIFFs, and in recent images I have found that using the packbits
> compression actually creates larger files than when I use no compression.
>
> -Jonathan
|
|
|