diff options
author | Kore Nordmann <github@kore-nordmann.de> | 2006-09-21 14:32:58 +0000 |
---|---|---|
committer | Kore Nordmann <github@kore-nordmann.de> | 2006-09-21 14:32:58 +0000 |
commit | cd436f9af6cc7a26fad8c77b56b9fbf7f6efee5c (patch) | |
tree | 2b44278732dab6c2e3313ea7f76a607f26f40e0b /src | |
parent | dcd873bad4300cc0b91b3686a10077dd921b9ead (diff) | |
download | zetacomponents-graph-cd436f9af6cc7a26fad8c77b56b9fbf7f6efee5c.zip zetacomponents-graph-cd436f9af6cc7a26fad8c77b56b9fbf7f6efee5c.tar.gz |
- Added tests for jpeg generation
- Added tests for usage of GIF images
Diffstat (limited to 'src')
-rw-r--r-- | src/driver/gd.php | 2 | ||||
-rw-r--r-- | src/options/gd_driver.php | 6 |
2 files changed, 7 insertions, 1 deletions
diff --git a/src/driver/gd.php b/src/driver/gd.php index c34ec28..c75755a 100644 --- a/src/driver/gd.php +++ b/src/driver/gd.php @@ -1105,7 +1105,7 @@ class ezcGraphGdDriver extends ezcGraphDriver imagepng( $image, $file ); break; case IMG_JPEG: - imagejpeg( $image, $file, $this->options->quality ); + imagejpeg( $image, $file, $this->options->jpegQuality ); break; } } diff --git a/src/options/gd_driver.php b/src/options/gd_driver.php index 0037892..5b72186 100644 --- a/src/options/gd_driver.php +++ b/src/options/gd_driver.php @@ -13,6 +13,8 @@ * @property int $imageFormat * Type of generated image. * Should be one of those: IMG_PNG, IMG_JPEG + * @property int $jpegQuality + * Quality of generated jpeg * @property int $detail * Count of degrees to render one polygon for in circular arcs * @property int $supersampling @@ -41,6 +43,7 @@ class ezcGraphGdDriverOptions extends ezcGraphDriverOptions public function __construct( array $options = array() ) { $this->properties['imageFormat'] = IMG_PNG; + $this->properties['jpegQuality'] = 70; $this->properties['detail'] = 1; $this->properties['shadeCircularArc'] = .5; $this->properties['supersampling'] = 2; @@ -75,6 +78,9 @@ class ezcGraphGdDriverOptions extends ezcGraphDriverOptions throw new ezcBaseValueException( $propertyName, $propertyValue, 'Unsupported image type.' ); } break; + case 'jpegQuality': + $this->properties['jpegQuality'] = max( 0, min( 100, (int) $propertyValue ) ); + break; case 'detail': $this->properties['detail'] = max( 1, (int) $propertyValue ); break; |