Add more log
This commit is contained in:
parent
2d2687a642
commit
ed33882ca3
@ -1,7 +1,7 @@
|
|||||||
<?php
|
<?php
|
||||||
/*
|
/*
|
||||||
* PHP-Barcode 0.3pl1
|
* PHP-Barcode 0.3pl1
|
||||||
|
|
||||||
* PHP-Barcode generates
|
* PHP-Barcode generates
|
||||||
* - Barcode-Images using libgd2 (png, jpg, gif)
|
* - Barcode-Images using libgd2 (png, jpg, gif)
|
||||||
* - HTML-Images (using 1x1 pixel and html-table)
|
* - HTML-Images (using 1x1 pixel and html-table)
|
||||||
@ -13,22 +13,22 @@
|
|||||||
* barcode-encoder which uses GNU-Barcode
|
* barcode-encoder which uses GNU-Barcode
|
||||||
* genbarcode can encode EAN-13, EAN-8, UPC, ISBN, 39, 128(a,b,c),
|
* genbarcode can encode EAN-13, EAN-8, UPC, ISBN, 39, 128(a,b,c),
|
||||||
* I25, 128RAW, CBR, MSI, PLS
|
* I25, 128RAW, CBR, MSI, PLS
|
||||||
* genbarcode is available at www.ashberg.de/bar
|
* genbarcode is available at www.ashberg.de/bar
|
||||||
|
|
||||||
* (C) 2001,2002,2003,2004 by Folke Ashberg <folke@ashberg.de>
|
* (C) 2001,2002,2003,2004 by Folke Ashberg <folke@ashberg.de>
|
||||||
|
|
||||||
* The newest version can be found at http://www.ashberg.de/bar
|
* The newest version can be found at http://www.ashberg.de/bar
|
||||||
|
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
* the Free Software Foundation; either version 2 of the License, or
|
* the Free Software Foundation; either version 2 of the License, or
|
||||||
* (at your option) any later version.
|
* (at your option) any later version.
|
||||||
|
|
||||||
* This program is distributed in the hope that it will be useful,
|
* This program is distributed in the hope that it will be useful,
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
* GNU General Public License for more details.
|
* GNU General Public License for more details.
|
||||||
|
|
||||||
* You should have received a copy of the GNU General Public License
|
* You should have received a copy of the GNU General Public License
|
||||||
* along with this program; if not, write to the Free Software
|
* along with this program; if not, write to the Free Software
|
||||||
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||||
@ -52,7 +52,7 @@ $text_color=Array(0,0,0);
|
|||||||
/* location the the ttf-font */
|
/* location the the ttf-font */
|
||||||
/* the file arialbd.ttf isn't included! */
|
/* the file arialbd.ttf isn't included! */
|
||||||
|
|
||||||
/* SAMPLE1 :
|
/* SAMPLE1 :
|
||||||
* use arialbd.ttf located in same directory like the script
|
* use arialbd.ttf located in same directory like the script
|
||||||
* which includes/requires php-barcode.php
|
* which includes/requires php-barcode.php
|
||||||
*/
|
*/
|
||||||
@ -92,7 +92,7 @@ else
|
|||||||
|
|
||||||
require("encode_bars.php"); /* build-in encoders */
|
require("encode_bars.php"); /* build-in encoders */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* barcode_outimage(text, bars [, scale [, mode [, total_y [, space ]]]] )
|
* barcode_outimage(text, bars [, scale [, mode [, total_y [, space ]]]] )
|
||||||
*
|
*
|
||||||
* Outputs an image using libgd
|
* Outputs an image using libgd
|
||||||
@ -123,7 +123,7 @@ function barcode_outimage($text, $bars, $scale = 1, $mode = "png",
|
|||||||
if ($total_y<1) $total_y=(int)$scale * 60;
|
if ($total_y<1) $total_y=(int)$scale * 60;
|
||||||
if (!$space)
|
if (!$space)
|
||||||
$space=array('top'=>2*$scale,'bottom'=>2*$scale,'left'=>2*$scale,'right'=>2*$scale);
|
$space=array('top'=>2*$scale,'bottom'=>2*$scale,'left'=>2*$scale,'right'=>2*$scale);
|
||||||
|
|
||||||
/* count total width */
|
/* count total width */
|
||||||
$xpos=0;
|
$xpos=0;
|
||||||
$width=true;
|
$width=true;
|
||||||
@ -137,7 +137,7 @@ function barcode_outimage($text, $bars, $scale = 1, $mode = "png",
|
|||||||
if (ereg("[a-z]", $val)){
|
if (ereg("[a-z]", $val)){
|
||||||
/* tall bar */
|
/* tall bar */
|
||||||
$val=ord($val)-ord('a')+1;
|
$val=ord($val)-ord('a')+1;
|
||||||
}
|
}
|
||||||
$xpos+=$val*$scale;
|
$xpos+=$val*$scale;
|
||||||
$width=true;
|
$width=true;
|
||||||
}
|
}
|
||||||
@ -209,7 +209,7 @@ function barcode_outimage($text, $bars, $scale = 1, $mode = "png",
|
|||||||
|
|
||||||
// DOLCHANGE LDR
|
// DOLCHANGE LDR
|
||||||
global $filebarcode;
|
global $filebarcode;
|
||||||
|
|
||||||
/* output the image */
|
/* output the image */
|
||||||
$mode=strtolower($mode);
|
$mode=strtolower($mode);
|
||||||
if ($mode=='jpg' || $mode=='jpeg'){
|
if ($mode=='jpg' || $mode=='jpeg'){
|
||||||
@ -224,7 +224,7 @@ function barcode_outimage($text, $bars, $scale = 1, $mode = "png",
|
|||||||
{
|
{
|
||||||
imagepng($im,$filebarcode);
|
imagepng($im,$filebarcode);
|
||||||
// End DOLCHANGE LDR
|
// End DOLCHANGE LDR
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
header("Content-Type: image/png; name=\"barcode.png\"");
|
header("Content-Type: image/png; name=\"barcode.png\"");
|
||||||
imagepng($im);
|
imagepng($im);
|
||||||
@ -264,7 +264,7 @@ function barcode_outtext($code,$bars){
|
|||||||
return $bar_line;
|
return $bar_line;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* barcode_outhtml(text, bars [, scale [, total_y [, space ]]] )
|
* barcode_outhtml(text, bars [, scale [, total_y [, space ]]] )
|
||||||
*
|
*
|
||||||
* returns(!) HTML-Code for barcode-image using html-code (using a table and with black.png and white.png)
|
* returns(!) HTML-Code for barcode-image using html-code (using a table and with black.png and white.png)
|
||||||
@ -302,7 +302,7 @@ function barcode_outhtml($code, $bars, $scale = 1, $total_y = 0, $space = ''){
|
|||||||
'<TR><TD><img src=white.png height="'.$space['top'].'" width=1></TD></TR>'."\n".
|
'<TR><TD><img src=white.png height="'.$space['top'].'" width=1></TD></TR>'."\n".
|
||||||
'<TR><TD>'."\n".
|
'<TR><TD>'."\n".
|
||||||
'<IMG src=white.png height="'.$height2.'" width="'.$space['left'].'">';
|
'<IMG src=white.png height="'.$height2.'" width="'.$space['left'].'">';
|
||||||
|
|
||||||
$width=true;
|
$width=true;
|
||||||
for ($i=0;$i<strlen($bars);$i++){
|
for ($i=0;$i<strlen($bars);$i++){
|
||||||
$val=strtolower($bars[$i]);
|
$val=strtolower($bars[$i]);
|
||||||
@ -375,18 +375,18 @@ function barcode_encode_genbarcode($code,$encoding){
|
|||||||
* You can use the following encodings (when you have genbarcode):
|
* You can use the following encodings (when you have genbarcode):
|
||||||
* ANY choose best-fit (default)
|
* ANY choose best-fit (default)
|
||||||
* EAN 8 or 13 EAN-Code
|
* EAN 8 or 13 EAN-Code
|
||||||
* UPC 12-digit EAN
|
* UPC 12-digit EAN
|
||||||
* ISBN isbn numbers (still EAN-13)
|
* ISBN isbn numbers (still EAN-13)
|
||||||
* 39 code 39
|
* 39 code 39
|
||||||
* 128 code 128 (a,b,c: autoselection)
|
* 128 code 128 (a,b,c: autoselection)
|
||||||
* 128C code 128 (compact form for digits)
|
* 128C code 128 (compact form for digits)
|
||||||
* 128B code 128, full printable ascii
|
* 128B code 128, full printable ascii
|
||||||
* I25 interleaved 2 of 5 (only digits)
|
* I25 interleaved 2 of 5 (only digits)
|
||||||
* 128RAW Raw code 128 (by Leonid A. Broukhis)
|
* 128RAW Raw code 128 (by Leonid A. Broukhis)
|
||||||
* CBR Codabar (by Leonid A. Broukhis)
|
* CBR Codabar (by Leonid A. Broukhis)
|
||||||
* MSI MSI (by Leonid A. Broukhis)
|
* MSI MSI (by Leonid A. Broukhis)
|
||||||
* PLS Plessey (by Leonid A. Broukhis)
|
* PLS Plessey (by Leonid A. Broukhis)
|
||||||
*
|
*
|
||||||
* return:
|
* return:
|
||||||
* array[encoding] : the encoding which has been used
|
* array[encoding] : the encoding which has been used
|
||||||
* array[bars] : the bars
|
* array[bars] : the bars
|
||||||
@ -397,7 +397,7 @@ function barcode_encode($code,$encoding){
|
|||||||
if (
|
if (
|
||||||
((eregi("^ean$", $encoding)
|
((eregi("^ean$", $encoding)
|
||||||
&& ( strlen($code)==12 || strlen($code)==13)))
|
&& ( strlen($code)==12 || strlen($code)==13)))
|
||||||
|
|
||||||
|| (($encoding) && (eregi("^isbn$", $encoding))
|
|| (($encoding) && (eregi("^isbn$", $encoding))
|
||||||
&& (( strlen($code)==9 || strlen($code)==10) ||
|
&& (( strlen($code)==9 || strlen($code)==10) ||
|
||||||
(((ereg("^978", $code) && strlen($code)==12) ||
|
(((ereg("^978", $code) && strlen($code)==12) ||
|
||||||
@ -405,7 +405,7 @@ function barcode_encode($code,$encoding){
|
|||||||
|
|
||||||
|| (( !isset($encoding) || !$encoding || (eregi("^ANY$", $encoding) ))
|
|| (( !isset($encoding) || !$encoding || (eregi("^ANY$", $encoding) ))
|
||||||
&& (ereg("^[0-9]{12,13}$", $code)))
|
&& (ereg("^[0-9]{12,13}$", $code)))
|
||||||
|
|
||||||
){
|
){
|
||||||
/* use built-in EAN-Encoder */
|
/* use built-in EAN-Encoder */
|
||||||
$bars=barcode_encode_ean($code, $encoding);
|
$bars=barcode_encode_ean($code, $encoding);
|
||||||
@ -438,7 +438,10 @@ function barcode_encode($code,$encoding){
|
|||||||
* array[text] : text-positioning info
|
* array[text] : text-positioning info
|
||||||
*/
|
*/
|
||||||
function barcode_print($code, $encoding="ANY", $scale = 2 ,$mode = "png" ){
|
function barcode_print($code, $encoding="ANY", $scale = 2 ,$mode = "png" ){
|
||||||
dol_syslog("$code $encoding $scale $mode");
|
|
||||||
|
// DOLCHANGE LDR Add log
|
||||||
|
dol_syslog("php-barcode.php:barcode_print $code $encoding $scale $mode");
|
||||||
|
|
||||||
$bars=barcode_encode($code,$encoding);
|
$bars=barcode_encode($code,$encoding);
|
||||||
if (!$bars) return;
|
if (!$bars) return;
|
||||||
if (!$mode) $mode="png";
|
if (!$mode) $mode="png";
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user