Skip Menu |

This queue is for tickets about the Imager-QRCode CPAN distribution.

Report information
The Basics
Id: 89548
Status: resolved
Priority: 0/
Queue: Imager-QRCode

People
Owner: kurihara [...] cpan.org
Requestors: DREBOLO [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in: 0.034
Fixed in: (no value)



Subject: Image not beeing created
I had a issue where my qrcode image was not created when I used the same code in a differente server, and I didn't got any error comming from Imager::QRCode I only found out what was the problem when I Dumped "Imager::QRCode" object. $VAR1 = bless( { 'IMG' => bless( do{\(my $o = 39669808)}, 'Imager::ImgRaw' ), 'DEBUG' => 0, 'ERRSTR' => 'format \'png\' not supported - formats bmp, ico, pnm, raw, sgi, tga available for writing - Can\'t locate Imager/File/PNG.pm' }, 'Imager' ); then I know that I also needed to install Imager::File::PNG.pm mybe Imager::QRCode should complain more strongly about this
Do you have libpng on the different server? Maybe Imager will not install Imager::File::PNG if libpng is not installed on the different server. On 2013-10月-16 水 06:31:03, DREBOLO wrote: Show quoted text
> I had a issue where my qrcode image was not created when I used the > same code in a differente server, and I didn't got any error comming > from Imager::QRCode > > I only found out what was the problem when I Dumped "Imager::QRCode" > object. > > $VAR1 = bless( { > 'IMG' => bless( do{\(my $o = 39669808)}, > 'Imager::ImgRaw' ), > 'DEBUG' => 0, > 'ERRSTR' => 'format \'png\' not supported - formats > bmp, ico, pnm, raw, sgi, tga available for writing - Can\'t locate > Imager/File/PNG.pm' > }, 'Imager' ); > > then I know that I also needed to install Imager::File::PNG.pm > > mybe Imager::QRCode should complain more strongly about this
Could be that, but right now I don't have way to confirm it. Later I will investigate further and tell you something more. Thank you On Wed Oct 16 13:54:55 2013, KURIHARA wrote: Show quoted text
> Do you have libpng on the different server? > > Maybe Imager will not install Imager::File::PNG if libpng is not > installed on the different server. > > On 2013-10月-16 水 06:31:03, DREBOLO wrote:
> > I had a issue where my qrcode image was not created when I used the > > same code in a differente server, and I didn't got any error comming > > from Imager::QRCode > > > > I only found out what was the problem when I Dumped "Imager::QRCode" > > object. > > > > $VAR1 = bless( { > > 'IMG' => bless( do{\(my $o = 39669808)}, > > 'Imager::ImgRaw' ), > > 'DEBUG' => 0, > > 'ERRSTR' => 'format \'png\' not supported - formats > > bmp, ico, pnm, raw, sgi, tga available for writing - Can\'t locate > > Imager/File/PNG.pm' > > }, 'Imager' ); > > > > then I know that I also needed to install Imager::File::PNG.pm > > > > mybe Imager::QRCode should complain more strongly about this
I just installed Imager::QRCode in a perlbrew perl 5.18.1 and attached the full installation log. I can see among other things that Imager complained about not having: PNG: Not found via pkg-config PNG: Generic: includes not found - libraries not found PNG: v1.6: includes not found - libraries not found PNG: v1.5: includes not found - libraries not found PNG: v1.4: includes not found - libraries not found PNG: v1.2: includes not found - libraries not found PNG: v1.0: includes not found - libraries not found PNG: base (+libz): includes not found - libraries not found PNG: v1.6 (+libz): includes not found - libraries not found PNG: v1.5 (+libz): includes not found - libraries not found PNG: v1.4 (+libz): includes not found - libraries not found PNG: v1.2 (+libz): includes not found - libraries not found PNG: v1.0 (+libz): includes not found - libraries not found PNG: Checking if the compiler can find them on its own Warning (mostly harmless): No library found for -lpng PNG: Test code failed: Can't link/include 'png.h', 'stdio.h', 'png' The problem here is that we only see those warnings if we install it with -v option from cpan, and in the case I reported before was a colleague that installed this new server and he was not awere that we need to have PNG support. On Wed Oct 16 13:54:55 2013, KURIHARA wrote: Show quoted text
> Do you have libpng on the different server? > > Maybe Imager will not install Imager::File::PNG if libpng is not > installed on the different server. > > On 2013-10月-16 水 06:31:03, DREBOLO wrote:
> > I had a issue where my qrcode image was not created when I used the > > same code in a differente server, and I didn't got any error comming > > from Imager::QRCode > > > > I only found out what was the problem when I Dumped "Imager::QRCode" > > object. > > > > $VAR1 = bless( { > > 'IMG' => bless( do{\(my $o = 39669808)}, > > 'Imager::ImgRaw' ), > > 'DEBUG' => 0, > > 'ERRSTR' => 'format \'png\' not supported - formats > > bmp, ico, pnm, raw, sgi, tga available for writing - Can\'t locate > > Imager/File/PNG.pm' > > }, 'Imager' ); > > > > then I know that I also needed to install Imager::File::PNG.pm > > > > mybe Imager::QRCode should complain more strongly about this
Subject: Imager-QRCode-install.log

Message body is not shown because it is too large.

I've attached a patch that updates the documentation to make errors more apparent. I don't think this is a bug in Imager::QRCode since in the end you're just calling ->write() on an Imager object, but we could make it easier for consumers to discover what's wrong.
Subject: 0001-Update-synopsis-to-show-how-to-handle-errors-writing.patch
From 85b0ad3401d1ee4bdbf470c164520da332e52925 Mon Sep 17 00:00:00 2001 From: Matthew Horsfall <wolfsage@gmail.com> Date: Tue, 11 Oct 2016 19:47:12 -0400 Subject: [PATCH] Update synopsis to show how to handle errors writing files If certain image formats aren't supported by Imager, ->write() will return but fail to write out the image file. In those cases, the caller should check ->errstr to find out why. This should help with RT #89548. --- lib/Imager/QRCode.pm | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/Imager/QRCode.pm b/lib/Imager/QRCode.pm index c94aefc..d3d0eeb 100644 --- a/lib/Imager/QRCode.pm +++ b/lib/Imager/QRCode.pm @@ -71,13 +71,15 @@ Imager::QRCode - Generate QR Code with Imager using libqrencode darkcolor => Imager::Color->new(0, 0, 0), ); my $img = $qrcode->plot("blah blah"); - $img->write(file => "qrcode.gif"); + $img->write(file => "qrcode.gif") + or die "Failed to write: " . $img->errstr; # or exporting function use Imager::QRCode qw(plot_qrcode); my $img = plot_qrcode("blah blah", \%params); - $img->write(file => "qrcode.gif"); + $img->write(file => "qrcode.gif") + or die "Failed to write: " . $img->errstr; =head1 DESCRIPTION -- 1.9.1
Thank you for your patch of the docs. I will apply your patch next release. On 2016-10月-11 火 19:51:57, WOLFSAGE wrote: Show quoted text
> I've attached a patch that updates the documentation to make errors > more apparent. > > I don't think this is a bug in Imager::QRCode since in the end you're > just calling ->write() on an Imager object, but we could make it > easier for consumers to discover what's wrong.
I just release new version(0.035).