diff options
author | Tom Moor <tom.moor@gmail.com> | 2015-05-16 11:13:43 -0700 |
---|---|---|
committer | Tom Moor <tom.moor@gmail.com> | 2015-05-16 11:13:43 -0700 |
commit | 7bf53fcfebb5bc04b78a8cf23862778256de2241 (patch) | |
tree | d39767c2988b791b51885399e16dc84a113bf931 | |
parent | c721859ea6e8feebb30da3839d1e170ddf1e8a41 (diff) | |
parent | 428e426f5b180d6b791c5a35c20841cffc91e822 (diff) | |
download | fastimage-master.zip fastimage-master.tar.gz fastimage-master.tar.bz2 |
Merge pull request #8 from jdreesen/patch-1HEADorigin/masterorigin/HEADmaster
Reset $type and $str on close() to enable subsequent uses of load()
-rw-r--r-- | Fastimage.php | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/Fastimage.php b/Fastimage.php index 2f7f9b8..0d3b9a6 100644 --- a/Fastimage.php +++ b/Fastimage.php @@ -34,7 +34,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; + } } @@ -226,7 +232,7 @@ class FastImage { $size = unpack("C*", $str); - return ($size[1] << 8) + $size[2]; + return ($size[1] << 8) + $size[2]; } |