|
|
| Vorheriges Thema anzeigen :: Nächstes Thema anzeigen |
| Autor |
Nachricht |
dbart Neuer User
Anmeldungsdatum: 13.04.2007 Beiträge: 3
|
13.04.2007 13:52 image_barcode not working |
|
|
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 |
|
 |
Berdir Power User
Anmeldungsdatum: 22.09.2005 Beiträge: 1347
|
13.04.2007 14:21 |
|
|
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 |
|
 |
dbart Neuer User
Anmeldungsdatum: 13.04.2007 Beiträge: 3
|
|
| Nach oben |
|
 |
Berdir Power User
Anmeldungsdatum: 22.09.2005 Beiträge: 1347
|
13.04.2007 15:10 |
|
|
| 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 |
|
 |
dbart Neuer User
Anmeldungsdatum: 13.04.2007 Beiträge: 3
|
13.04.2007 15:27 |
|
|
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 |
|
 |
Berdir Power User
Anmeldungsdatum: 22.09.2005 Beiträge: 1347
|
13.04.2007 15:54 |
|
|
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 |
|
 |
|
|
|
Zu Deinen Favoriten hinzufügen
|
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
|
|