Skip Menu |

This queue is for tickets about the Tk CPAN distribution.

Report information
The Basics
Id: 128103
Status: resolved
Priority: 0/
Queue: Tk

People
Owner: Nobody in particular
Requestors: martin.jacobs [...] arcor.de
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in:
  • 804.034_500
  • 804.035



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
Download perl-tk-photo-xpm-bug.zip
application/zip 5.9k

Message body not shown because it is not plain text.

On 2018-12-25 16:04:38, martin.jacobs@arcor.de wrote: Show quoted text
> 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. >
Confimed. What works is using Pixmap instead of Photo: ... my $thumbnail_p = $main->Pixmap(-file => $filename); ... Regards, Slaven
On 2019-02-02 06:19:04, SREZIC wrote: Show quoted text
> On 2018-12-25 16:04:38, martin.jacobs@arcor.de wrote:
> > 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. > >
> > Confimed. What works is using Pixmap instead of Photo: > > ... > my $thumbnail_p = $main->Pixmap(-file => $filename); > ...
I found the problem --- the XPM file contained a "/*" sequence in the image data, and imgXPM.c used to ignore all lines containing this sequence --- which is obviously wrong. Also the (missing) error message was suboptimal --- in fact at this point it was a short read. The Tcl/Tk code does not have the "/*" check, so I removed it also in the Perl/Tk variant. This is now available on github; you can get it using git clone https://github.com/eserte/perl-tk.git -b rt-128103 Can you confirm that the fix works also for you? Regards, Slaven
Subject: Re: [rt.cpan.org #128103] Tk::Photo importer for XPM fails on some files
Date: Sat, 9 Feb 2019 09:38:39 +0100 (CET)
To: Slaven_Rezic via RT <bug-Tk [...] rt.cpan.org>
From: Martin Jacobs <martin.jacobs [...] arcor.de>
On Samstag 2019-02-02 15:18, Slaven_Rezic via RT wrote: Show quoted text
>Date: Sat, 2 Feb 2019 15:18:31 >From: Slaven_Rezic via RT <bug-Tk@rt.cpan.org> >To: martin.jacobs@arcor.de >Subject: [rt.cpan.org #128103] Tk::Photo importer for XPM fails on some files > > <URL: https://rt.cpan.org/Ticket/Display.html?id=128103 > > > On 2019-02-02 06:19:04, SREZIC wrote:
>> On 2018-12-25 16:04:38, martin.jacobs@arcor.de wrote:
>>> 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. >>>
>> >> Confimed. What works is using Pixmap instead of Photo: >> >> ... >> my $thumbnail_p = $main->Pixmap(-file => $filename); >> ...
> > I found the problem --- the XPM file contained a "/*" sequence in the image data, and imgXPM.c used to ignore all lines containing this sequence --- which is obviously wrong. Also the (missing) error message was suboptimal --- in fact at this point it was a short read. > > The Tcl/Tk code does not have the "/*" check, so I removed it also in the Perl/Tk variant. This is now available on github; you can get it using > > git clone https://github.com/eserte/perl-tk.git -b rt-128103 > > Can you confirm that the fix works also for you? > > Regards, > Slaven >
Thank you. Yes this fixes the issue. I did get a local clone as suggested and compiled it. Calling perl with appropriate -I option pointing to new artefacts made test script successfully load and display the previously failing image. :-) Kind regards Martin -- Dipl-Ing. Martin Jacobs * Windsbach * martin.jacobs@arcor.de
On 2019-02-09 03:44:45, martin.jacobs@arcor.de wrote: Show quoted text
> On Samstag 2019-02-02 15:18, Slaven_Rezic via RT wrote: >
> > Date: Sat, 2 Feb 2019 15:18:31 > > From: Slaven_Rezic via RT <bug-Tk@rt.cpan.org> > > To: martin.jacobs@arcor.de > > Subject: [rt.cpan.org #128103] Tk::Photo importer for XPM fails on > > some files > > > > <URL: https://rt.cpan.org/Ticket/Display.html?id=128103 > > > > > On 2019-02-02 06:19:04, SREZIC wrote:
> >> On 2018-12-25 16:04:38, martin.jacobs@arcor.de wrote:
> >>> 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. > >>>
> >> > >> Confimed. What works is using Pixmap instead of Photo: > >> > >> ... > >> my $thumbnail_p = $main->Pixmap(-file => $filename); > >> ...
> > > > I found the problem --- the XPM file contained a "/*" sequence in the > > image data, and imgXPM.c used to ignore all lines containing this > > sequence --- which is obviously wrong. Also the (missing) error > > message was suboptimal --- in fact at this point it was a short read. > > > > The Tcl/Tk code does not have the "/*" check, so I removed it also in > > the Perl/Tk variant. This is now available on github; you can get it > > using > > > > git clone https://github.com/eserte/perl-tk.git -b rt-128103 > > > > Can you confirm that the fix works also for you? > > > > Regards, > > Slaven > >
> > Thank you. Yes this fixes the issue. > > I did get a local clone as suggested and compiled it. Calling > perl with appropriate -I option pointing to new artefacts made > test script successfully load and display the previously > failing image. :-) > > Kind regards > > Martin
In the meantime, the fix is available in recent Perl/Tk. Regards, Slaven