Example #1
0
 /**
  * Create image from string
  * @param string $string String of binary image data
  * @return Image An instance of image
  */
 public static function createFromString($string)
 {
     $image = new self();
     $imageResource = imagecreatefromstring($string);
     $image->setImageResource($imageResource);
     $image->setWidth(imagesx($imageResource));
     $image->setHeight(imagesy($imageResource));
     $image->setType(IMAGETYPE_UNKNOWN);
     return $image;
 }