summaryrefslogtreecommitdiffstats
path: root/ds9/library/saveimage.tcl
diff options
context:
space:
mode:
authorWilliam Joye <wjoye@cfa.harvard.edu>2018-05-29 21:27:31 (GMT)
committerWilliam Joye <wjoye@cfa.harvard.edu>2018-05-29 21:27:31 (GMT)
commitb8395e8e32cccb75565a170160772857087901de (patch)
tree2494425c02897874ba1a957a51224522c4a2e10a /ds9/library/saveimage.tcl
parent41505b4129a005e96c6afc3344ccf61097884fbd (diff)
downloadblt-b8395e8e32cccb75565a170160772857087901de.zip
blt-b8395e8e32cccb75565a170160772857087901de.tar.gz
blt-b8395e8e32cccb75565a170160772857087901de.tar.bz2
update parsers
Diffstat (limited to 'ds9/library/saveimage.tcl')
-rw-r--r--ds9/library/saveimage.tcl121
1 files changed, 4 insertions, 117 deletions
diff --git a/ds9/library/saveimage.tcl b/ds9/library/saveimage.tcl
index 45ac769..4729deb 100644
--- a/ds9/library/saveimage.tcl
+++ b/ds9/library/saveimage.tcl
@@ -154,123 +154,10 @@ proc ProcessSaveImageCmd {varname iname} {
UpdateDS9
RealizeDS9
- global debug
- if {$debug(tcl,parser)} {
- saveimage::YY_FLUSH_BUFFER
- saveimage::yy_scan_string [lrange $var $i end]
- saveimage::yyparse
- incr i [expr $saveimage::yycnt-1]
- } else {
-
- set format {}
- set param {}
- set fn [lindex $var $i]
- if {$fn == {}} {
- return
- }
-
- # backward compatibility
- switch $fn {
- fits -
- eps -
- gif -
- tiff -
- jpeg -
- png {
- set format $fn
- set fn {}
- incr i
- }
- jpg {
- set format jpeg
- set fn {}
- incr i
- }
- tif {
- set format tiff
- set fn {}
- incr i
- }
- mpeg {
- # backward compatibility
- global movie
- incr i
- set fn [lindex $var $i]
- if {[string is integer -strict $fn]} {
- incr i
- set fn [lindex $var $i]
- }
- set movie(action) slice
- Movie $fn
- }
- }
-
- # try again
- if {$fn == {}} {
- set fn [lindex $var $i]
- if {$fn == {}} {
- return
- }
-
- if {[string is integer -strict $fn] ||
- $fn == {none} || $fn == {jpeg} ||
- $fn == {backbits} || $fn == {deflate}} {
- set param $fn
- set fn {}
- incr i
- }
- }
-
- # one last time
- if {$fn == {}} {
- set fn [lindex $var $i]
- if {$fn == {}} {
- return
- }
- }
-
- global saveimage
- if {$format == {}} {
- set format [ExtToFormat $fn]
- }
-
- if {$param == {}} {
- set param [string tolower [lindex $var [expr $i+1]]]
- switch $format {
- fits -
- eps -
- gif -
- png {}
- jpeg {
- if {[string is integer -strict $param]} {
- set saveimage(jpeg,quality) $param
- incr i
- }
- }
- tiff {
- switch $param {
- none -
- jpeg -
- packbits -
- deflate {
- set saveimage(tiff,compress) $param
- incr i
- }
- }
- }
- }
- }
-
- switch -- $format {
- fits {FileLast fitsfbox $fn}
- eps {FileLast epsfbox $fn}
- gif {FileLast giffbox $fn}
- jpeg {FileLast jpegfbox $fn}
- tiff {FileLast tifffbox $fn}
- png {FileLast pngfbox $fn}
- }
- SaveImage $fn $format
-}
+ saveimage::YY_FLUSH_BUFFER
+ saveimage::yy_scan_string [lrange $var $i end]
+ saveimage::yyparse
+ incr i [expr $saveimage::yycnt-1]
}
proc SaveimageCmdSet {which value {cmd {}}} {