cvs: php4 /pear/Cache Graphics.php
| From: | Sterling Hughes | Date: | Wed, 22 Aug 2001 00:20:53 +0000 |
| Subject: | cvs: php4 /pear/Cache Graphics.php | ||
| Groups: | php.pear.cvs | ||
| Request: | Send a blank email to pear-cvs+get-616@lists.php.net to get a copy of this message | ||
sterling Tue Aug 21 20:20:53 2001 EDT
Modified files:
/php4/pear/Cache Graphics.php
Log:
Cache this
Index: php4/pear/Cache/Graphics.php
diff -u php4/pear/Cache/Graphics.php:1.8 php4/pear/Cache/Graphics.php:1.9
--- php4/pear/Cache/Graphics.php:1.8 Tue Aug 21 20:04:34 2001
+++ php4/pear/Cache/Graphics.php Tue Aug 21 20:20:51 2001
@@ -15,7 +15,7 @@
// | Authors: Ulf Wendel <ulf.wendel@phpdoc.de> |
// +----------------------------------------------------------------------+
//
-// $Id: Graphics.php,v 1.8 2001/08/22 00:04:34 jon Exp $
+// $Id: Graphics.php,v 1.9 2001/08/22 00:20:51 sterling Exp $
require_once 'Cache.php';
@@ -66,7 +66,7 @@
* the output buffer. Modify it if required!
*
* @author Ulf Wendel <ulf.wendel@phpdoc.de>
-* @version $Id: Graphics.php,v 1.8 2001/08/22 00:04:34 jon Exp $
+* @version $Id: Graphics.php,v 1.9 2001/08/22 00:20:51 sterling Exp $
* @package Cache
*/
class Cache_Graphics extends Cache {
@@ -211,12 +211,14 @@
return new Cache_Error('You must provide an ID for and image to be cached!',
__FILE__, __LINE__);
$id = $this->generateID(array('id' => $id, 'format' =>
strtolower($format)));
-
+
+ $types = ImageTypes();
+
// Check if the requested image type is supported by the GD lib.
// If not, try a callback to the first available image type.
- if (!isset($this->imagetypes[$format]) || !(ImageTypes() &
$this->imagetypes[$format])) {
+ if (!isset($this->imagetypes[$format]) || !($types & $this->imagetypes[$format]))
{
foreach ($this->imagetypes as $supported => $bitmask) {
- if (ImageTypes() & $bitmask) {
+ if ($types & $bitmask) {
new Cache_Error("The build in GD lib does not support the image type
$format. Fallback to $supported.", __FILE__, __LINE__);
} else {
return new Cache_Error("Hmm, is your PHP build with GD support? Can't
find any supported types.", __FILE__, __LINE__);
@@ -270,11 +272,13 @@
$id = $this->generateID( array('id' => $id, 'format' =>
strtolower($format)) );
+ $types = ImageTypes();
+
// Check if the requested image type is supported by the GD lib.
// If not, try a callback to the first available image type.
- if (!isset($this->imagetypes[$format]) || !(ImageTypes() &
$this->imagetypes[$format])) {
+ if (!isset($this->imagetypes[$format]) || !($types & $this->imagetypes[$format]))
{
foreach ($this->imagetypes as $supported => $bitmask)
- if (ImageTypes() & $bitmask)
+ if ($types & $bitmask)
new Cache_Error("The build in GD lib does not support the image type
$format. Fallback to $supported.", __FILE__, __LINE__);
else
return new Cache_Error("Hmm, is your PHP build with GD support? Can't
find any supported types.", __FILE__, __LINE__);