}
}
+ /**
+ * @see wcf\system\image\adapter\IImageAdapter::createEmptyImage()
+ */
+ public function createEmptyImage($width, $height) {
+ $this->image = imageCreate($width, $height);
+ $this->type = IMAGETYPE_PNG;
+ $this->setColor(0xFF, 0xFF, 0xFF);
+ $this->color = null;
+ }
+
/**
* @see wcf\system\image\adapter\IImageAdapter::createThumbnail()
*/
imageJPEG($image, '', 90);
}
- $thumbnail = ob_get_contents();
+ $stream = ob_get_contents();
ob_end_clean();
- file_put_contents($filename, $thumbnail);
+ file_put_contents($filename, $stream);
}
/**
*/
public function loadFile($file);
+ /**
+ * Creates a new empty image.
+ *
+ * @param integer $width
+ * @param integer $height
+ */
+ public function createEmptyImage($width, $height);
+
/**
* Creates a thumbnail from previously loaded image.
*
$this->adapter->loadFile($file);
}
+ /**
+ * @see wcf\system\image\adapter\IImageAdapter::createEmptyImage()
+ */
+ public function createEmptyImage($width, $height) {
+ $this->adapter->createEmptyImage($width, $height);
+ }
+
/**
* @see wcf\system\image\adapter\IImageAdapter::createThumbnail()
*/
/**
* @see wcf\system\image\adapter\IImageAdapter::writeImage()
*/
- public function writeImage($image, $filename) {
+ public function writeImage($image, $filename = null) {
+ if ($filename === null) {
+ $filename = $image;
+ $image = $this->adapter->getImage();
+ }
+
$this->adapter->writeImage($image, $filename);
}
$this->width = $this->imagick->getImageWidth();
}
+ /**
+ * @see wcf\system\image\adapter\IImageAdapter::createEmptyImage()
+ */
+ public function createEmptyImage($width, $height) {
+ $this->imagick->newImage($width, $height, 'white');
+ }
+
+
/**
* @see wcf\system\image\adapter\IImageAdapter::createThumbnail()
*/