[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: images in Perl/Tk



Hi,

On Mon, 18 Mar 2024 19:23:39 +0000
"mick.crane" <mick.crane@gmail.com> wrote:

> I try to load images with Perl/Tk but there is message,
> "couldn't recognize data in image file "test.jpeg" at 
> /usr/lib/x86_64-linux-gnu/perl5/5.38/Tk/Image.pm line 21"
> I've tried different images/pngs/jpgs with same error.
> images load OK in other viewers.
> Installed tkpng with apt.
> 
> Anybody successfully used images with Perl/Tk?
> Would Tk::JPEG/Tk::PNG from cpan be happy with the Debian Tk and may 
> possibly help recognise the file format?
> Or is there some 'pruning' of the images, made with Gimp, needed to
> work with Tk?
> 
> mick
> 

I never used Tk with Perl, but first, you do not need tkpng for png
images anymore, pngs have been supported natively by Tk for years. Maybe
tkpng is broken (as at least some versions of img::png that came with
debian have been)?
Second, Tk does not support jpegs without third-party
extensions; probably img::jpeg can help, so you could try to 
install libtk-img with apt and then do the Perl equivalent of

   package require img::jpeg

Have a nice day,

Michael


Reply to: