--- libphp-jpgraph-1.5.2.orig/src/jpgraph.php +++ libphp-jpgraph-1.5.2/src/jpgraph.php @@ -30,7 +30,8 @@ // regenerate the image. Note that even if reading the cache is // disabled the cached will still be updated with the newly generated // image. Set also "USE_CACHE" below. -DEFINE("READ_CACHE",true); +//DEFINE("READ_CACHE",true); +DEFINE("READ_CACHE",false); // Should the cache be used at all? By setting this to false no // files will be generated in the cache directory. @@ -38,7 +39,8 @@ // false will still create the image in the cache directory // just not use it. By setting USE_CACHE=false no files will even // be generated in the cache directory. -DEFINE("USE_CACHE",true); +//DEFINE("USE_CACHE",true); +DEFINE("USE_CACHE",false); // If the color palette is full should JpGraph try to allocate // the closest match? If you plan on using background image or @@ -104,6 +106,7 @@ DEFINE("FF_COMIC",14); DEFINE("FF_ARIAL",15); DEFINE("FF_BOOK",16); +DEFINE("FF_LIBERATION_SANS",17); // TTF Font styles DEFINE("FS_NORMAL",1); @@ -244,18 +247,20 @@ //user // if( isset($GLOBALS['php_errormsg']) ) { - JpGraphError::Raise("General PHP error:
".$GLOBALS['php_errormsg']); + // Disabled by Debian to prevent showing PHP5 warnings + // ("Non-static method called statically") + // JpGraphError::Raise("General PHP error:
".$GLOBALS['php_errormsg']); } // // Check what version of the GD library is being used // if(function_exists('imagecopyresampled') ) { - $gd2 = true; + $GLOBALS['gd2'] = true; $copyfunc = "imagecopyresampled"; } elseif(function_exists('imagecopyresized')) { $copyfunc = "imagecopyresized"; - $gd2 = false; + $GLOBALS['gd2'] = false; } else { JpGraphError::Raise("JpGraph Error: Your PHP installation does not @@ -280,10 +285,10 @@ $img_format="gif"; elseif( $supported & IMG_JPG ) $img_format="jpeg"; - if( !isset($HTTP_SERVER_VARS['PHP_SELF']) ) + if( !isset($_SERVER['PHP_SELF']) ) JpGraphError::Raise("JpGraph Error: Can't access PHP_SELF, PHP global variable. You can't run PHP from command line if you want to use the 'auto' naming of cache or image files."); - $fname=basename($HTTP_SERVER_VARS['PHP_SELF']); + $fname=basename($_SERVER['PHP_SELF']); // Replace the ".php" extension with the image format extension return substr($fname,0,strlen($fname)-4).".".$img_format; } @@ -426,6 +431,11 @@ //--------------- // PUBLIC METHODS + // OW : fake method to have reporting working + //function SetMargin($x1, $x2, $x3, $x4) { + // return true; + //} + // Should the grid be in front or back of the plot? function SetGridDepth($aDepth) { $this->grid_depth=$aDepth; @@ -490,6 +500,8 @@ // Specify a background image function SetBackgroundImage($aFileName,$aBgType=BKIMG_FILLPLOT,$aImgFormat="png") { +/* CB Not any more bugging + if( $GLOBALS["gd2"] && !USE_TRUECOLOR ) { JpGraphError::Raise("JpGraph Error:You are using GD 2.x and are trying to use a background images on a non truecolor image.
@@ -500,6 +512,7 @@ using any truetype fonts with truecolor images will result in very poor quality fonts."); } +*/ $this->background_image = $aFileName; $this->background_image_type=$aBgType; @@ -1064,6 +1077,10 @@ $this->img->Rectangle(0,0,$this->img->width-1,$this->img->height-1); } } + // Set Margin by Christian Bayle + function SetMargin($lm,$rm,$tm,$bm) { + $this->img->SetMargin($lm,$rm,$tm,$bm); + } } // Class @@ -1078,13 +1095,14 @@ function TTF() { // Base file names for available fonts $this->font_fam=array( - FF_COURIER => TTF_DIR."courier", - FF_VERDANA => TTF_DIR."verdana", - FF_TIMES => TTF_DIR."times", - FF_HANDWRT => TTF_DIR."handwriting", - FF_COMIC => TTF_DIR."comic", - FF_ARIAL => TTF_DIR."arial", - FF_BOOK => TTF_DIR."bookant"); + FF_COURIER => TTF_DIR."Courier_New", + FF_VERDANA => TTF_DIR."Verdana", + FF_TIMES => TTF_DIR."Times", + FF_HANDWRT => TTF_DIR."Handwriting", + FF_COMIC => TTF_DIR."Comic", + FF_ARIAL => TTF_DIR."Arial", + FF_BOOK => TTF_DIR."Bookant", + FF_LIBERATION_SANS => LIBERATION_DIR."LiberationSans-Regular"); } //--------------- @@ -1096,11 +1114,11 @@ switch( $style ) { case FS_NORMAL: break; - case FS_BOLD: $f .= "bd"; + case FS_BOLD: $f .= "_Bold"; break; - case FS_ITALIC: $f .= "i"; + case FS_ITALIC: $f .= "_Italic"; break; - case FS_BOLDIT: $f .= "bi"; + case FS_BOLDIT: $f .= "_Bold_Italic"; break; default: JpGraphError::Raise("JpGraph Error: Unknown TTF Style."); @@ -3183,7 +3201,7 @@ } } } - elseif($this->font_family >= FF_COURIER && $this->font_family <= FF_BOOK) { // TTF font + elseif($this->font_family >= FF_COURIER && $this->font_family <= FF_LIBERATION_SANS) { // TTF font $file = $this->ttf->File($this->font_family,$this->font_style); $angle=$dir; $bbox=ImageTTFBBox($this->font_size,$angle,$file,$txt); @@ -3208,7 +3226,7 @@ } } else - JpGraphError::Raise("JpGraph Error: Unknown font font family specification. "); + JpGraphError::Raise("JpGraph Error: Unknown font family specification: ". $this->font_family); } function SetMargin($lm,$rm,$tm,$bm) { @@ -3490,7 +3508,16 @@ } function FilledCircle($xc,$yc,$r) { - imagefilledellipse($this->img,$xc,$yc,2*$r,2*$r,$this->current_color); + if( $GLOBALS['gd2'] ) { + imagefilledellipse($this->img,$xc,$yc,2*$r,2*$r,$this->current_color); + } + else { + for( $i=1; $i < 2*$r; $i += 2 ) { + $this->Arc($xc,$yc,$i,$i,0,360); + $this->Arc($xc,$yc,$i+1,$i,0,360); + $this->Arc($xc,$yc,$i+1,$i+1,0,360); + } + } } // Linear Color InterPolation --- libphp-jpgraph-1.5.2.orig/src/jpgraph_dir.php +++ libphp-jpgraph-1.5.2/src/jpgraph_dir.php @@ -16,7 +16,7 @@ //------------------------------------------------------------------ // The full absolute name of directory to be used as a cache. This directory MUST // be readable and writable for PHP. Must end with '/' -DEFINE("CACHE_DIR","/tmp/jpgraph_cache/"); +DEFINE("CACHE_DIR","/var/cache/jpgraph/"); // The URL relative name where the cache can be found, i.e // under what HTTP directory can the cache be found. Normally @@ -25,6 +25,9 @@ DEFINE("APACHE_CACHE_DIR","/jpgraph_cache/"); // Directory for TTF fonts. Must end with '/' -DEFINE("TTF_DIR","/usr/local/fonts/ttf/"); +DEFINE("TTF_DIR","/usr/share/fonts/truetype/msttcorefonts/"); + +// Add Free liberation font as suggested by Alain Peyrat +DEFINE("LIBERATION_DIR","/usr/share/fonts/truetype/liberation/"); ?> --- libphp-jpgraph-1.5.2.orig/src/jpgraph_pie3d.php +++ libphp-jpgraph-1.5.2/src/jpgraph_pie3d.php @@ -88,7 +88,7 @@ function ExplodeSlice($e) { - JpGraphError::Raise("JpGraph Error: Exploding slices are not (yet) implemented for 3d pies graphs."); + //JpGraphError::Raise("JpGraph Error: Exploding slices are not (yet) implemented for 3d pies graphs."); //$this->explode_slice=$e; } --- libphp-jpgraph-1.5.2.orig/src/jpgraph_gantt.php +++ libphp-jpgraph-1.5.2/src/jpgraph_gantt.php @@ -1157,9 +1157,9 @@ $this->iCaptionMargin=$aMarg; } - function GetLineNbr() { - return 0; - } +// function GetLineNbr() { +// return 0; +// } function GetAbsHeight($aImg) { return 0; @@ -1189,7 +1189,7 @@ $this->iProgress = $aProg; } - function SetPattern($aPattern,$aColor="blue",$aDensity=98) { + function SetPattern($aPattern,$aColor="blue",$aDensity=100) { $this->iPattern = $aPattern; $this->iColor = $aColor; $this->iDensity = $aDensity; --- libphp-jpgraph-1.5.2.orig/src/Examples/text-example2.php +++ libphp-jpgraph-1.5.2/src/Examples/text-example2.php @@ -1,6 +1,6 @@ SetColor("white"); --- libphp-jpgraph-1.5.2.orig/src/Examples/example3.1.php +++ libphp-jpgraph-1.5.2/src/Examples/example3.1.php @@ -1,6 +1,6 @@ Tue, 13 Nov 2012 19:29:03 -0400 + +libphp-jpgraph (1.5.2-12) unstable; urgency=low + + * Add support for free LIBERATION fonts + and depends on ttf-liberation (Thanks to Alain Peyrat) or non free + alternate ttf-mscorefonts-installer (Closes: #490037) + * Claim support for php5 and remove php4 depends in control + file (Closes: #524172) + * Changed section from web to php + + -- Christian Bayle Sun, 26 Apr 2009 23:46:16 +0200 + +libphp-jpgraph (1.5.2-11+u1) unstable; urgency=low + + * Non-maintainer upload. + * Applied patch that prevented PHP5 compile time generated warning + "Non-static method called statically" to appear on screen and corrupts + the output of graphics. The usual error_reporting and display_errors + had no effect as a custom error handler was installed by the library. + Closes: #436289 + + -- Christian Hammers Sat, 10 Jan 2009 00:10:30 +0100 + +libphp-jpgraph (1.5.2-11) unstable; urgency=low + + * Added support for php5(-gd), reviewed all example that seems to work + (Closes: #424795) affected by php4-removal + + -- Christian Bayle Wed, 23 May 2007 01:24:50 +0200 + +libphp-jpgraph (1.5.2-10.1) unstable; urgency=low + + * Non-Maintainer upload with maintainer consent. + + * Apply patch to make $gd2 global really global (Closes: #354637). + + * Bring out-of-sync debhelper version in sync to level 5. + * Install upstream Changelog. + * Update FSF address in debian/copyright. + * Checked for policy version 3.7.2. + + -- Thijs Kinkhorst Wed, 5 Jul 2006 16:51:18 +0200 + +libphp-jpgraph (1.5.2-10) unstable; urgency=low + + * msttcorefonts dir changed (in package msttcorefonts) + from /usr/share/fonts/truetype/ to /usr/share/fonts/truetype/msttcorefonts/ + (Closes: #275281) + + -- Christian Bayle Thu, 7 Oct 2004 21:24:42 +0200 + +libphp-jpgraph (1.5.2-9) unstable; urgency=low + + * Applied a patch proposed by Guillaume Smet that add a fake + SetMargin method and a doing nothing ExplodeSlice method, to make this + make work better with gforge package. + * Finnaly commented the fake SetMargin + + -- Christian Bayle Mon, 13 Sep 2004 22:34:42 +0200 + +libphp-jpgraph (1.5.2-8) unstable; urgency=low + + * Changed dependancy on php4-gd2 with php4-gd (Closes: #257999) + * I explain in copyright file why I don't upgrade to new QPLed + non + commercial use clause upstream version, this is not DFSG compliant (Closes: #258104) + + -- Christian Bayle Wed, 1 Sep 2004 22:58:59 +0200 + +libphp-jpgraph (1.5.2-7) unstable; urgency=low + + * Added alternate depend on libapache2-mod-php4 to support apache2 + (closes bug#255315) + + -- Christian Bayle Fri, 25 Jun 2004 09:52:29 +0200 + +libphp-jpgraph (1.5.2-6) stable; urgency=low + + * Woody backport + + -- Christian Bayle Thu, 15 Apr 2004 11:22:26 +0200 + +libphp-jpgraph (1.5.2-5) unstable; urgency=low + + * Changed dependancy on php4-gd for php4-gd2 + * Changed density in jpgraph_gantt.php as suggested by Joseph Miller (joff) + + -- Christian Bayle Thu, 15 Apr 2004 11:20:58 +0200 + +libphp-jpgraph (1.5.2-4) stable; urgency=low + + * Woody backport + + -- Christian Bayle Sat, 27 Mar 2004 17:45:25 +0100 + +libphp-jpgraph (1.5.2-3) unstable; urgency=low + + * New First upload (closes #173601) ITP + * This package was released by Luis Bustamante + * Luis who allowed me to upload the package will maintain the package + when he will have more time to work on it. + * For some licensing reason it was probably rejected + * This is the packaging of and older GPLed release + * I changed cache and ttf path in ./src/jpgraph_dir.php + * I disabled caching in ./src/jpgraph.php + * I corrected imagefilledelipse broken function + * I corrected path in examples + * I corrected font names + * I added gantt->SetMargin function needed by gforge package + + -- Christian Bayle Thu, 19 Feb 2004 23:50:14 +0100 + --- libphp-jpgraph-1.5.2.orig/debian/control +++ libphp-jpgraph-1.5.2/debian/control @@ -0,0 +1,33 @@ +Source: libphp-jpgraph +Section: php +Priority: optional +Maintainer: Christian Bayle +Build-Depends: debhelper (>= 5) +Standards-Version: 3.8.1.0 + +Package: libphp-jpgraph +Architecture: all +Depends: libapache2-mod-php5 | php5 | php5-cgi, php5-gd, fonts-liberation +Description: Object oriented graph library for php5 + JpGraph is an object oriented class library for php5. JpGraph makes + it easy to draw both "quick and dirty" graphs with a minimum of code + and complex professional graphs which requires a very fine grain + control. JpGraph is equally well suited for both scientific and + business type of graphs. Though claimed as non php5 works perfectly + for all samples with php5. This is the last GPLed version, + more recent version are non DFSG complianti (See copyright file). + +Package: libphp-jpgraph-examples +Architecture: all +Depends: libphp-jpgraph +Description: Object oriented graph library for php5 (examples) + JpGraph is an object oriented class library for php5. JpGraph makes + it easy to draw both "quick and dirty" graphs with a minimum of code + and complex professional graphs which requires a very fine grain + control. JpGraph is equally well suited for both scientific and + business type of graphs. Though claimed as non php5 works perfectly + for all samples with php5. This is the last GPLed version, + more recent version are non DFSG complianti (See copyright file). + . + This package contains examples for using JpGraph library. + --- libphp-jpgraph-1.5.2.orig/debian/copyright +++ libphp-jpgraph-1.5.2/debian/copyright @@ -0,0 +1,37 @@ +This package was debianized by Luis Bustamante on +Thu, 19 Dec 2002 13:48:02 -0500. +For licensing reasons only GPLed 1.5.2 is now packaged by Christian Bayle + + +To be clear for those that would ask why I don't upload the new 1.17 QPLed +version. You can read on the home page: + +"JpGraph is released under a dual license. QPL 1.0 (Qt Free Licensee) For +non-commercial, open-source and educational use and JpGraph Professional +License for commercial use." +This is not compliant with DFSG #6 +"The license must not restrict anyone from making use of the program in a +specific field of endeavor. For example, it may not restrict the program from +being used in a business, or from being used for genetic research." + +It was downloaded from: +http://www.aditus.nu/jpgraph/downloads/jpgraph-1.5.2.tar.gz + +Upstream Author: Johan Persson +Copyright (C) 2001 Johan Persson + +Copyright: + 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 + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License with + the Debian GNU/Linux distribution in file /usr/share/common-licenses/GPL-2; + if not, write to the Free Software Foundation, Inc., 51 Franklin Street, + Fifth Floor, Boston, MA 02110-1301, USA