private function drawImage(awImage $image, $return = FALSE, $header = TRUE) { $format = $image->getFormatString(); // Test if format is available if ((imagetypes() & $image->getFormat()) === FALSE) { awImage::drawError("Class Image: Format '" . $format . "' is not available on your system. Check that your PHP has been compiled with the good libraries."); } // Get some infos about this image switch ($format) { case 'jpeg': $function = 'imagejpeg'; break; case 'png': $function = 'imagepng'; break; case 'gif': $function = 'imagegif'; break; } // Send headers to the browser if ($header === TRUE) { $image->sendHeaders(); } if ($return) { ob_start(); } $function($this->resource); if ($return) { return ob_get_clean(); } }