/** * Convert the loaded image to a JPEG and then return a structure for the PDF creator. * This function requires GD library and write access to the directory defined on K_PATH_CACHE constant. * @param $image (image) Image object. * @param $quality (int) JPEG quality. * return image JPEG image object. * @public static */ public static function _toJPEG($image, $quality) { $tempname = TcpdfStatic::getObjFilename('jpg'); imagejpeg($image, $tempname, $quality); imagedestroy($image); $retvars = self::_parsejpeg($tempname); // tidy up by removing temporary image unlink($tempname); return $retvars; }