Just so you know what the code looks like (nothing fancy at all), here
is the action within my Orders controller. By commenting out the
setFilePath it should output to the browser:

function storeBarcode($oid) {
        $this->layout=NULL;
        $this->autoRender = false;
        $bc = new DataMatrix();
        $bc->setBGColor("WHITE");
        $bc->setBarColor("BLACK");
        $bc->setEncoding("AUTO");
        $bc->setFormat("8x18");
        $bc->setQuiteZone("10");
        $bc->setModuleSize("4");
        //$bc->setFilePath('img/barcodes/');
        $bc->paint($oid);
}

Here is a link to a working app outside Cake:
http://www.intraviewvs.net/barcode/show_barcode.php?code=12345678

Here is a link to the Cake install (use FF to view source):
https://www.intraviewvs.net/apps/orders/storeBarcode/12345678

The code in each case is identical, aside from the Cake-isms (turning
off render and layout).

Any insight at all would be stellar at this point...


On Nov 27, 3:01 am, jonathan <[EMAIL PROTECTED]> wrote:
> Hey Wayne,
>
> The image is a PNG so I am using the content-type MIME for PNG.
>
> I do not know how any spaces could work their way in there.  The same
> code works outside Cake.
>
> It's called rDataMatrix and relies on the bundled GD Library.
>
> Again, outside Cake, nothing but joy.  Inside Cake, one of my few
> moments of misery.  There must be something with the framework that is
> altering the image information, or I need to do one more step to keep
> the image in the proper format?  Even when I store to a file, the
> image is corrupted.
>
> On Nov 27, 2:42 am, "Wayne Fay" <[EMAIL PROTECTED]> wrote:
>
>
>
> > Did you set the headers correctly (content type etc)?
> > Do you have a space (or more than one) appearing at the beginning of
> > your image file which would cause these problems?
>
> > What PHP barcode generation library are you using?
>
> > Wayne
>
> > On 11/27/07, jonathan <[EMAIL PROTECTED]> wrote:
>
> > > Hi All,
>
> > > This seems to have come up a number of times before, but I have not
> > > found a definitive answer.  I am trying to generate a dynamic image
> > > (in this case, a barcode from a PHP barcode generation library).  I
> > > have tried every combination of headers, views, layouts, etc. and
> > > still all I get is the raw image string (in view source) and not the
> > > image properly rendered.  Even when I try to save the image to the
> > > filesystem, it is blank.  I know the library works, because I paste
> > > almost identical code outside of Cake and all is perfect.
>
> > > Does anyone have a definitive way to display image data in Cake?
> > > (Version 1.1x please ;)
>
> > > Thanks much,
> > > Jonathan- Hide quoted text -
>
> > - Show quoted text -- Hide quoted text -
>
> - Show quoted text -
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to