Skip Menu |

This queue is for tickets about the Wx CPAN distribution.

Report information
The Basics
Id: 65881
Status: rejected
Priority: 0/
Queue: Wx

People
Owner: Nobody in particular
Requestors: dolmen [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Wishlist
Broken in: 0.98
Fixed in: (no value)



Subject: Export wxMemory{In,Out}putStream
wxMemoryInputStream seems to be the missing piece to be able to build a Wx::Image from JPEG data contained in a memory buffer. Use case: I need this to build an photo managing application. I'm extracting the thumbnail data from the JPEG files using Image::ExifTool. The thumbnail data itself is encoded as a JPEG. This could also be used to display images loaded from file using other Perl libraries instead of the wxWidgets libraries. -- Olivier Mengué - http://search.cpan.org/~dolmen/ http://github.com/dolmen/
CC: wxperl-users [...] perl.org
Subject: Re: [rt.cpan.org #65881] Export wxMemory{In,Out}putStream
Date: Fri, 18 Feb 2011 20:47:50 +0000
To: bug-Wx [...] rt.cpan.org
From: Mark Dootson <mark.dootson [...] znix.com>
Hi, Untested, but you may like to give the following a try my $jpegdata = <rawjepgdata> open my $file, '<', \$jpegdata; my $handler = Wx::JPEGHandler->new(); my $image = Wx::Image->new(); $handler->LoadFile( $image, $file ); Mark On 18/02/2011 19:36, Olivier 'dolmen' Mengué via RT wrote: Show quoted text
> Fri Feb 18 14:36:15 2011: Request 65881 was acted upon. > Transaction: Ticket created by DOLMEN > Queue: Wx > Subject: Export wxMemory{In,Out}putStream > Broken in: 0.98 > Severity: Wishlist > Owner: Nobody > Requestors: dolmen@cpan.org > Status: new > Ticket<URL: https://rt.cpan.org/Ticket/Display.html?id=65881> > > > wxMemoryInputStream seems to be the missing piece to be able to build a > Wx::Image from JPEG data contained in a memory buffer. > > > Use case: > I need this to build an photo managing application. I'm extracting the > thumbnail data from the JPEG files using Image::ExifTool. The thumbnail > data itself is encoded as a JPEG. > This could also be used to display images loaded from file using other > Perl libraries instead of the wxWidgets libraries. > > -- > Olivier Mengué - http://search.cpan.org/~dolmen/ http://github.com/dolmen/
CC: wxperl-users [...] perl.org
Subject: Re: [rt.cpan.org #65881] Export wxMemory{In,Out}putStream
Date: Sat, 19 Feb 2011 11:39:23 +0100
To: bug-Wx [...] rt.cpan.org
From: Mattia Barbon <mattia.barbon [...] libero.it>
On 18/02/11 21.47, Mark Dootson wrote: Hi, Show quoted text
> Untested, but you may like to give the following a try > > my $jpegdata = <rawjepgdata> > open my $file, '<', \$jpegdata; > my $handler = Wx::JPEGHandler->new(); > my $image = Wx::Image->new(); > $handler->LoadFile( $image, $file );
The code above should work; using open my $fh, '<', \$data; my $img = Wx::Image->new( $fh, wxBITMAP_TYPE_JPEG ); should work as well (it's part of wxPerl test suite). Regards, Mattia
Le 2011-02-19 05:39:40, mattia.barbon@libero.it a écrit : Show quoted text
> open my $fh, '<', \$data; > my $img = Wx::Image->new( $fh, wxBITMAP_TYPE_JPEG ); > > should work as well (it's part of wxPerl test suite).
Thanks Mattia. It works! It's great to have such a good integration of Wx with Perl. I'm closing the bug. -- Olivier Mengué - http://search.cpan.org/~dolmen/ http://github.com/dolmen/