summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJacob Dreesen <jacob@hdreesen.de>2015-05-11 15:58:19 +0200
committerJacob Dreesen <jacob@hdreesen.de>2015-05-11 15:58:19 +0200
commit428e426f5b180d6b791c5a35c20841cffc91e822 (patch)
tree6a187556b6c87e567cb3d816d193b398ad86ce8f
parent6a63411c985a2aae537fe2b3fae95a7cc9ede1f6 (diff)
downloadfastimage-428e426f5b180d6b791c5a35c20841cffc91e822.zip
fastimage-428e426f5b180d6b791c5a35c20841cffc91e822.tar.gz
fastimage-428e426f5b180d6b791c5a35c20841cffc91e822.tar.bz2
Reset $type and $str on close() to enable subsequent uses of load()
-rw-r--r--Fastimage.php12
1 files changed, 9 insertions, 3 deletions
diff --git a/Fastimage.php b/Fastimage.php
index 1db470e..816995f 100644
--- a/Fastimage.php
+++ b/Fastimage.php
@@ -36,7 +36,13 @@ class FastImage
public function close()
{
- if ($this->handle) fclose($this->handle);
+ if ($this->handle)
+ {
+ fclose($this->handle);
+ $this->handle = null;
+ $this->type = null;
+ $this->str = null;
+ }
}
@@ -229,7 +235,7 @@ class FastImage
{
$size = unpack("C*", $str);
- return ($size[1] << 8) + $size[2];
+ return ($size[1] << 8) + $size[2];
}
@@ -237,4 +243,4 @@ class FastImage
{
$this->close();
}
-} \ No newline at end of file
+}