Added by Mickael PERRAUD, last edited by Mickael PERRAUD on Sep 10, 2008  (view change)

Labels

 
(None)

Zend Framework: Zend_Image_Barcode Component Proposal

Proposed Component Name Zend_Image_Barcode
Developer Notes http://framework.zend.com/wiki/display/ZFDEV/Zend_Image_Barcode
Proposers Mickael PERRAUD
Revision 0.1 - 15 March 2008: Initial proposal creation.
0.2 - 25 May 2008 : Correction and additions
0.3 - 13 July 2008: Add prototype and more description (wiki revision: 24)

Table of Contents

1. Overview

Zend_Image_Barcode is a simple component that create barcode.

2. References

3. Component Requirements, Constraints, and Acceptance Criteria

  • This component will generate barcode image.

4. Dependencies on Other Framework Components

  • PHP Extension : GD
  • Zend_Exception

5. Theory of Operation

Full example site: Barcode Test

Zend_Image_Barcode can easily create barcode without any parameter setting except the type and the value to encode.

However, Zend_Image_Barcode is entirely customizable:

  • independent adjustment of width of bars (thin, thick), font
  • global adjustment for this by factor
  • setting of font (TTF or gd built-in fonts)
  • activation of checksum
  • setting color (background and bars)
  • setting of result image (height, width, type)
  • creating blank image or using an existant resource
  • exception handling with image rendering
  • automatic render or return resource

6. Milestones / Tasks

  • Milestone 1: [DONE] Create the proposal
  • Milestone 2: [DONE] Initial class design
  • Milestone 3: Submit the proposal for community review
  • Milestone 4: Create working prototype
  • Milestone 5: Create code-covering unit tests.
  • Milestone 6: Writing documentation

7. Class Index

  • Zend_Image_Barcode_Exception
  • Zend_Image_Barcode (factory class)
  • Zend_Image_Barcode_Abstract
  • Zend_Image_Barcode_Int25
  • Zend_Image_Barcode_Code39
  • Additional will come later (EAN, Code128...)

8. Use Cases

9. Class Skeletons

What needs to be done on this proposal before moving it on to community review?

,Wil

Looks interesting, is there a way to see the code already?

Also, do you think it would be possible to broaden the scope and use Zend_Image_Barcode_Writer to be able to add Zend_Image_Barcode_Reader later on? Just food for thoughts.

On your test page, you compare to the PEAR class - somehow the image (generated by the PEAR class) doesn't load though. This is more of personal, how is your class different from the PEAR class? Where do you see the advantages of using this code vs. the PEAR code (except from PHP5 and that it's part of the ZendFramework "package").

Thanks!

Hi,

I don't have any SVN but I put a view of the current code on the same page as the examples.

I thought of no reader for the moment. What do you think? You provide an image to the reader and it returns the value of the barcode?

I have no problem on my local server with PEAR (code39), but effectively I will search.

I realize this code to accept more than the common barcode (code39, code128, interleaved 2 of 5). For example: Kix ("Royal Dutch TPG Post KIX 4-State Barcode") or Postnet ("United States Postal Service Postnet"). Extending the Abstract class must be as easy as possible, just a translation from the coding map (or charset) to an array. I handle exceptions with image error which is a particular barcode. And finally, you can provide an existing image (for example a logo with a blank space) and retrieve the image with the barcode inside.

Thanks

Well, I think reading would be sweet.

I am not sure how to do it on Windows for example, since a *_Reader would have to interface OCR tools I guess, but I am sure it's doable on Linux/Unix. I don't know much about dependencies on external tools/libs and the Zend Framework, maybe your Zend liason could enlighten us.