diff options
author | Jacob Dreesen <jacob@hdreesen.de> | 2015-05-11 15:58:19 +0200 |
---|---|---|
committer | Jacob Dreesen <jacob@hdreesen.de> | 2015-05-11 15:58:19 +0200 |
commit | 428e426f5b180d6b791c5a35c20841cffc91e822 (patch) | |
tree | 6a187556b6c87e567cb3d816d193b398ad86ce8f | |
parent | 6a63411c985a2aae537fe2b3fae95a7cc9ede1f6 (diff) | |
download | fastimage-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.php | 12 |
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 +} |