Skip Menu |
 

This queue is for tickets about the GD-Barcode CPAN distribution.

Report information
The Basics
Id: 130095
Status: new
Priority: 0/
Queue: GD-Barcode

People
Owner: Nobody in particular
Requestors: simon [...] leaky.org
Cc:
AdminCc:

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



Subject: EAN13 barcode with text requires GD::Image palette mode not truecolour
MIME-Version: 1.0
X-Mailer: MIME-tools 5.504 (Entity 5.504)
Content-Disposition: inline
X-RT-Interface: Web
Message-ID: <rt-4.0.18-26084-1563356836-1550.0-0-0 [...] rt.cpan.org>
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: binary
X-RT-Original-Encoding: utf-8
X-RT-Encrypt: 0
X-RT-Sign: 0
Content-Length: 1146
Download (untitled) / with headers
text/plain 1.1k
If you have set the default for GD::Image to truecolour mode using GD::Image->trueColor(1); then when you create an EAN13 barcode with the numbers displayed below, the area where the text would be printed is solid black. This is because the default background colour seems to be set to black when using truecolour mode. In my application the first couple of calls to generate a barcode were working fine, but after displaying another dynamically generated image, the barcodes all had the solid black line underneath instead of text. To confirm it was the background colour at fault, I added a filledRectangle call just after allocating black and white colours so that it fills the newly created image with white. The barcode was then produced as expected. The only thing I could find different was the truecolour setting being set for the other image, adding GD::Image->trueColor(0); before generating the barcode causes it to work correctly every time. Suggested fix would be to set the truecolour mode to false when generating the barcode image, but the above works fine as a workaround for anyone else who discovers the same issue.


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.