PEAR-Forum.de Übersicht Thema anzeigen - image_barcode not working

image_barcode not working


 

PEAR-Forum.de Übersicht » Images
Neues Thema eröffnen Neue Antwort erstellen Diesen Beitrag ausdrucken
Vorheriges Thema anzeigen :: Nächstes Thema anzeigen  
Autor Nachricht
dbart
Neuer User


Anmeldungsdatum: 13.04.2007
Beiträge: 3

Beitrag13.04.2007 13:52    image_barcode not working Antworten mit Zitat

Hi,

i have problems creating barcode graphics using the image_barcode.

code is:
Code:

<body>

<?
require_once("Image/Barcode.php");
Image_Barcode::draw($_GET['NUM'], $_GET['TYP'], $_GET['IMG']);
?>

<img src="barcode.php?NUM=9780131471498&TYP=ean13&IMG=png"/>
<img src="barcode.php?NUM=9780131471498&TYP=int25&IMG=png"/>

</body>

but the graphics do not appear.
all i can see are two little red crosses.

gd support is enabled

would appreciate some tips

thx
Nach oben
Benutzer-Profile anzeigen Private Nachricht senden
Berdir
Power User


Anmeldungsdatum: 22.09.2005
Beiträge: 1347

Beitrag13.04.2007 14:21     Antworten mit Zitat

red cross could mean that there is an output wich is not an image, for example an error message.

Check the return message from draw:
PHP:
<?php
$return 
Image_Barcode::draw($_GET['NUM'], $_GET['TYP'], $_GET['IMG']); 
if (
PEAR::isError($return)) {
   die (
$return->getMessage());
}

And open the image-url directly in the browser or even in a simple text editor.

I am not sure if I understand your code right, make sure there are only these 4 lines in barcode.php, and nothing else above or under. (not even empty lines)
PHP:
<?
require_once("Image/Barcode.php");
Image_Barcode::draw($_GET['NUM'], $_GET['TYP'], $_GET['IMG']);
?>
Nach oben
Benutzer-Profile anzeigen Private Nachricht senden PEAR-User
dbart
Neuer User


Anmeldungsdatum: 13.04.2007
Beiträge: 3

Beitrag13.04.2007 14:47     Antworten mit Zitat

hi,

thx for your answer.
the error-message says:

"barcode is not supported"

but ean13 and int25 must be supported
this is not my code, got it from here

http://www.galileocomputing.de/openbook/php_pear/18_0_images-001.htm[url][/url]
Nach oben
Benutzer-Profile anzeigen Private Nachricht senden
Berdir
Power User


Anmeldungsdatum: 22.09.2005
Beiträge: 1347

Beitrag13.04.2007 15:10     Antworten mit Zitat

PHP:
<?php
if (!include_once('Image/Barcode/' $type '.php')) {
            return 
PEAR::raiseError($type ' barcode is not supported');
        }


It seems that this code failes.. check that for example Image/Barcode/int25.php is there and could be included.
Nach oben
Benutzer-Profile anzeigen Private Nachricht senden PEAR-User
dbart
Neuer User


Anmeldungsdatum: 13.04.2007
Beiträge: 3

Beitrag13.04.2007 15:27     Antworten mit Zitat

all files exist and they are where they're supposed to be

/php/pear/image/barcode/

include returns no error.

i have found another example right here

http://www.mribti.com/barcode/sample.php

online it works but when i download it and let it run on my localhost
the barcode is not displayed, again that little red cross

thx so far
Nach oben
Benutzer-Profile anzeigen Private Nachricht senden
Berdir
Power User


Anmeldungsdatum: 22.09.2005
Beiträge: 1347

Beitrag13.04.2007 15:54     Antworten mit Zitat

Are you sure that the parameters are correct when you call draw() ?

Try the following before draw() and open the "image" again directly in the browser

PHP:
<?php
var_dump
($_GET);
die();


I write this because you said that you had the error message "barcode is not supported", imho this should actually be: "test123 barcode is not supported" where test123 is the barcode type (for example int25). So it seems to me that $type is empty.

You could also try an hardcoded example:
PHP:
<?php
require_once("Image/Barcode.php"); 

$return Image_Barcode::draw('9780131471498''int25''png'); 
if (
PEAR::isError($return)) {
   die (
$return->getMessage());
}
Nach oben
Benutzer-Profile anzeigen Private Nachricht senden PEAR-User
Beiträge der letzten Zeit anzeigen:   
Diese Seite übersetzen
PEAR-Forum.de Übersicht » Images
Neues Thema eröffnen Neue Antwort erstellen Diesen Beitrag ausdrucken
   Alle Zeiten sind GMT + 1 Stunde
Seite 1 von 1

Zu Deinen Favoriten hinzufügen

 
Gehe zu:  
Du kannst keine Beiträge in dieses Forum schreiben.
Du kannst auf Beiträge in diesem Forum nicht antworten.
Du kannst deine Beiträge in diesem Forum nicht bearbeiten.
Du kannst deine Beiträge in diesem Forum nicht löschen.
Du kannst an Umfragen in diesem Forum nicht mitmachen.
Du kannst Dateien in diesem Forum nicht posten
Du kannst Dateien in diesem Forum herunterladen