This commit is contained in:
wangjinlei
2022-03-30 11:59:42 +08:00
parent 22aa65547b
commit 6313a35360
102 changed files with 3278 additions and 15906 deletions

View File

@@ -55,6 +55,8 @@ class TCPDF_IMAGES {
* Array of hinheritable SVG properties.
* @since 5.0.000 (2010-05-02)
* @public static
*
* @var string[]
*/
public static $svginheritprop = array('clip-rule', 'color', 'color-interpolation', 'color-interpolation-filters', 'color-profile', 'color-rendering', 'cursor', 'direction', 'display', 'fill', 'fill-opacity', 'fill-rule', 'font', 'font-family', 'font-size', 'font-size-adjust', 'font-stretch', 'font-style', 'font-variant', 'font-weight', 'glyph-orientation-horizontal', 'glyph-orientation-vertical', 'image-rendering', 'kerning', 'letter-spacing', 'marker', 'marker-end', 'marker-mid', 'marker-start', 'pointer-events', 'shape-rendering', 'stroke', 'stroke-dasharray', 'stroke-dashoffset', 'stroke-linecap', 'stroke-linejoin', 'stroke-miterlimit', 'stroke-opacity', 'stroke-width', 'text-anchor', 'text-rendering', 'visibility', 'word-spacing', 'writing-mode');
@@ -62,8 +64,8 @@ class TCPDF_IMAGES {
/**
* Return the image type given the file name or array returned by getimagesize() function.
* @param $imgfile (string) image file name
* @param $iminfo (array) array of image information returned by getimagesize() function.
* @param string $imgfile image file name
* @param array $iminfo array of image information returned by getimagesize() function.
* @return string image type
* @since 4.8.017 (2009-11-27)
* @public static
@@ -77,10 +79,7 @@ class TCPDF_IMAGES {
}
}
if (empty($type)) {
$fileinfo = pathinfo($imgfile);
if (isset($fileinfo['extension']) AND (!TCPDF_STATIC::empty_string($fileinfo['extension']))) {
$type = strtolower(trim($fileinfo['extension']));
}
$type = strtolower(trim(pathinfo(parse_url($imgfile, PHP_URL_PATH), PATHINFO_EXTENSION)));
}
if ($type == 'jpg') {
$type = 'jpeg';
@@ -90,9 +89,9 @@ class TCPDF_IMAGES {
/**
* Set the transparency for the given GD image.
* @param $new_image (image) GD image object
* @param $image (image) GD image object.
* return GD image object.
* @param resource $new_image GD image object
* @param resource $image GD image object.
* @return resource GD image object $new_image
* @since 4.9.016 (2010-04-20)
* @public static
*/
@@ -115,8 +114,8 @@ class TCPDF_IMAGES {
/**
* Convert the loaded image to a PNG 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 $tempfile (string) Temporary file name.
* @param resource $image Image object.
* @param string $tempfile Temporary file name.
* return image PNG image object.
* @since 4.9.016 (2010-04-20)
* @public static
@@ -138,10 +137,10 @@ class TCPDF_IMAGES {
/**
* 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.
* @param $tempfile (string) Temporary file name.
* return image JPEG image object.
* @param resource $image Image object.
* @param int $quality JPEG quality.
* @param string $tempfile Temporary file name.
* return array|false image JPEG image object.
* @public static
*/
public static function _toJPEG($image, $quality, $tempfile) {
@@ -155,8 +154,8 @@ class TCPDF_IMAGES {
/**
* Extract info from a JPEG file without using the GD library.
* @param $file (string) image file to parse
* @return array structure containing the image data
* @param string $file image file to parse
* @return array|false structure containing the image data
* @public static
*/
public static function _parsejpeg($file) {
@@ -234,8 +233,8 @@ class TCPDF_IMAGES {
/**
* Extract info from a PNG file without using the GD library.
* @param $file (string) image file to parse
* @return array structure containing the image data
* @param string $file image file to parse
* @return array|false structure containing the image data
* @public static
*/
public static function _parsepng($file) {