/** * Outputs the image to browser * * Sets headers Content-length and Content-type, and echoes the image in the specified format. * All other headers (such as Content-disposition) must be added manually. * * Example: * <code> * WideImage::load('image1.png')->resize(100, 100)->output('gif'); * </code> * * @param string $format Image format */ public function output($format) { $args = func_get_args(); $data = call_user_func_array(array($this, 'asString'), $args); $this->writeHeader('Content-length', strlen($data)); $this->writeHeader('Content-type', MapperFactory::mimeType($format)); echo $data; }
/** * Outputs the image to browser * * Sets headers Content-length and Content-type, and echoes the image in the specified format. * All other headers (such as Content-disposition) must be added manually. * * Example: * <code> * WideImage::load('image1.png')->resize(100, 100)->output('gif'); * </code> * * @param string $format Image format */ public function output($format) { $args = func_get_args(); $data = $this->asString(...$args); $this->writeHeader('Content-length', strlen($data)); $this->writeHeader('Content-type', MapperFactory::mimeType($format)); echo $data; }