Become a fan of Slashdot on Facebook


Forgot your password?
Check out the new SourceForge HTML5 internet speed test! No Flash necessary and runs on all devices. ×

Journal Tux2000's Journal: Perl/Tk: Tk::Photo and non-file images

Tk::Photo can be initialised from a file: $widget->Photo(-file=>'some.jpeg').

The manual page tells you that it can also read the image from string data: $widget->Photo(-data=>$data).

Reading the file into $data does not work, not even with binmode. What's missing in the manual page (at least in Version 3.014) is the fact that the string data must be base64-encoded! It's very convenient to use a here-document in base64, but it is not what I expect. I would have prefered to convert a base64 here-document manually before passing it to Tk::Photo.

This discussion has been archived. No new comments can be posted.

Perl/Tk: Tk::Photo and non-file images

Comments Filter:

You know, Callahan's is a peaceable bar, but if you ask that dog what his favorite formatter is, and he says "roff! roff!", well, I'll just have to...