Subject: | Tk::Photo importer for XPM fails on some files |
Date: | Tue, 25 Dec 2018 21:56:47 +0100 (CET) |
To: | bug-Tk [...] rt.cpan.org |
From: | Martin Jacobs <martin.jacobs [...] arcor.de> |
Hi,
Env:
Summary of my perl5 (revision 5 version 26 subversion 1)
configuration:
Platform:
osname=linux
osvers=4.12.14-lp150.12.28-default
archname=x86_64-linux-thread-multi
uname='reproducible'
[...]
perl-Tk-804.034 (including perl::Tk::Photo version 4.006)
I've stumbled across an issue with selected XPM files. Some
files, that are check ok by tool cxpm fail to be loaded by
perl-Tk.
Sample code
<begin perl code>
use Tk;
my $main = new MainWindow;
my $image_f = $main->Frame(-width => 100);
$image_f->pack();
my $filename = 'fails.xpm'; # this one fails!
# $filename = 'ok.xpm'; # this get's loaded
my $thumbnail_p = $main->Photo();
$thumbnail_p->configure(-file => $filename);
my $form_l = $image_f->Label(-image => $thumbnail_p);
$form_l->pack();
MainLoop;
<end of perl code>
Attached zip archive perl-tk-photo-xpm-bug.zip contains files
* TkShowPhoto.pl
* fails.xpm
* ok.xpm
This failure seems to be specific to perl::Tk. Same images are
loaded by native tcl/tk without complains (needs package Img).
Therefore I assume that xpm loader is part of perl-Tk and not
using code shared with tcl/tk.
To reproduce failure unpack files in a folder and enter
perl TkShowPhoto.pl
I get
at TkShowPhoto.pl line 9.
Uncomment second filename assignment and repeat and get a
small windows containing picture ok.xpm rendered.
KR
Martin Jacobs
Message body not shown because it is not plain text.