Skip to content

Commit abbc52c

Browse files
author
Mitch
committed
Inline getImagesizeFromString() as it's only used once, and is quite specific to loadFromString()
1 parent 5678368 commit abbc52c

File tree

1 file changed

+2
-11
lines changed

1 file changed

+2
-11
lines changed

src/ImageResize.php

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -77,16 +77,6 @@ public function __construct($filename = null)
7777
}
7878
}
7979

80-
/**
81-
* Get image size from string
82-
*
83-
* @param string $imagedata
84-
* @return array
85-
*/
86-
protected function getImagesizeFromString($imagedata){
87-
return @getimagesize('data://application/octet-stream;base64,' . base64_encode($imagedata));
88-
}
89-
9080
/**
9181
* Load image from string
9282
*
@@ -96,7 +86,8 @@ protected function getImagesizeFromString($imagedata){
9686
*/
9787
public function loadFromString($imagedata)
9888
{
99-
$image_info = $this->getImagesizeFromString($imagedata);
89+
$image_info = getimagesize('data://application/octet-stream;base64,' . base64_encode($imagedata));
90+
10091
if(!$image_info) {
10192
throw new \Exception('Could not load image from string');
10293
}

0 commit comments

Comments
 (0)