Wed, 04 May 2005

Simple smtm chart mode fix after Yahoo! switch

Yesterday I blogged about the charts breakage in my smtm stock market monitor / charter due to a switch from gif to png files at Yahoo!.

Turns out that it pretty easy to fix things -- loading the Tk::PNG module and then declaring the png format is all it takes:

--- smtm.orig   2004-08-03 21:52:57.000000000 -0500
+++ smtm        2005-05-04 09:58:25.820365000 -0500
@@ -35,6 +35,7 @@
 use Tk;                        # who needs gates in a world full o'windows?
 use Tk::Balloon;               # widget for context-sensitive help
 use Tk::FileSelect;            # widget for selecting files
+use Tk::PNG;                   # use PNG format in Photo widget for charts
 use vars qw{%options %chart};  # need to define here for SUB {} below

 my                             # seperate for Makefile.PL

@@ -952,7 +953,8 @@
       ## can pass the web-request response to Photo widget once base64 encoded
       $Dat{Image}[$arg] = $TL->Photo(-data => encode_base64($resp->content),
-                                    -format => "gif");
+## edd 04 May 2005: switch to png    -format => "gif");
+                                    -format => "png");
       $PH = $Dat{Image}[$arg];

       if (exists($Dat{Label}[$arg])) { # if we have a previous label
You may have to fetch the module from its CPAN source and do the perl Makefile.PL; make; make install dance. For 'that other OS', ActiveState Perl already includes it. For Debian, we're working on sorting this out.

/computers/linux/debian/packages | permanent link