Skip Menu |

This queue is for tickets about the Tk-Wizard CPAN distribution.

Report information
The Basics
Id: 54596
Status: resolved
Priority: 0/
Queue: Tk-Wizard

People
Owner: Nobody in particular
Requestors: keszler [...] srkconsulting.com
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in: 2.149
Fixed in: (no value)



Subject: imagepath and topimagepath accept only filenames
The imagepath and topimagepath parameters to a Tk::Wizard object are documented to accept a path to an image file, or: "A reference to a Base64-encoded image to pass in the -data field of the Tk::Photo object." Attempting to use the latter yields: "Can't find file at -imagepath: SCALAR(0x343e138)" The following patch adds a simple check to avoid the "-e" check producing that error message. =================================================================== =================================================================== --- Wizard.pm (revision 2.149) +++ Wizard.pm (working copy) @@ -564,10 +564,18 @@ -fontfamily => [ 'PASSIVE', undef, undef, $self->_font_family ], ); - if ( exists $args->{-imagepath} and not -e $args->{-imagepath} ) { + if ( + exists $args->{-imagepath} and + not ref($args->{-imagepath}) eq 'SCALAR' and + not -e $args->{-imagepath} + ) { Carp::confess "Can't find file at -imagepath: " . $args->{-imagepath}; } - if ( exists $args->{-topimagepath} and not -e $args->{-topimagepath} ) { + if ( + exists $args->{-topimagepath} and + not ref($args->{-topimagepath}) eq 'SCALAR' and + not -e $args->{-topimagepath} + ) { Carp::confess "Can't find file at -topimagepath: " . $args->{-topimagepath}; } $self->{-imagepath} = $args->{-imagepath}; ===================================================================
Many thanks for the patch - in the next release (soon) - shame on my "tests"... -- lgoddard at cpan org http://www.LeeGoddard.net