Proposal for "Image_Barcode2"

» Metadata » Status
  • Category: Images
  • Proposer: Dave Hall 
  • License: BSD Style
  • Status: Proposed
» Description
With Image_Barcode2 class you can create a barcode representation of a given string.

Generated barcodes can be outputted in any format supported by GD.

Image_Barcode2 is an updated version of Image_Barcode which runs with E_STRICT error reporting and requires PHP 5.

The package has been reorganized. Image_Barcode2 is now just a simple frontend for outputting the generated barcodes. Barcode image resources are created using subclasses of Image_Barcode2_Generator. The generators can be used as standalone objects which return a GD image resource. Image_Barcode2->draw() remains backward compatiable with 1.1.0

The data fed to the generators is validated by most classes before generating the barcode. A new "error" type barcode can be used for creating a placeholder error image on failure - see docs/examples/barcode_img.php for an example.

All classes have unit tests and the PHPDocs generate without errors. The non test classes pass PHP_CodeSniffer using the PEAR standard.

The code has been cleaned up a bit and made more consistent.

All outstanding bugs have been fixed too.
- Fixing #13794: Some numbers produce malformed "UPC A" barcodes
- Fixing #10594: $bSendToBrowser - "Only variable references should be returned by reference"

I originally proposed taking over maintainership of Image_Barcode, (see ) but due to the changes involved this wasn't really possible.

The code is available from />
(Note: the current license is PHP 3.01 as it derived from Image_Barcode, I will be contacting all contributors seeking relicensing to modified BSD - lets see how that goes)
» Dependencies » Links
  • PHP >= 5.2
» Timeline » Changelog
  • First Draft: 2008-12-29
  • Proposal: 2008-12-29