mirror of
https://github.com/Karaka-Management/Resources.git
synced 2026-02-16 12:18:40 +00:00
bug fixes
This commit is contained in:
parent
cdd0f7157b
commit
4c0e0ca179
|
|
@ -88,9 +88,9 @@ class TCPDF_IMAGES {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set the transparency for the given GD image.
|
* Set the transparency for the given GD image.
|
||||||
* @param resource $new_image GD image object
|
* @param \GdImage $new_image GD image object
|
||||||
* @param resource $image GD image object
|
* @param \GdImage $image GD image object
|
||||||
* @return resource GD image object $new_image
|
* @return \GdImage GD image object $new_image
|
||||||
* @since 4.9.016 (2010-04-20)
|
* @since 4.9.016 (2010-04-20)
|
||||||
* @public static
|
* @public static
|
||||||
*/
|
*/
|
||||||
|
|
@ -113,7 +113,7 @@ class TCPDF_IMAGES {
|
||||||
/**
|
/**
|
||||||
* Convert the loaded image to a PNG and then return a structure for the PDF creator.
|
* 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.
|
* This function requires GD library and write access to the directory defined on K_PATH_CACHE constant.
|
||||||
* @param resource $image image object
|
* @param \GdImage $image image object
|
||||||
* @param string $tempfile Temporary file name.
|
* @param string $tempfile Temporary file name.
|
||||||
* return image PNG image object.
|
* return image PNG image object.
|
||||||
* @since 4.9.016 (2010-04-20)
|
* @since 4.9.016 (2010-04-20)
|
||||||
|
|
@ -121,7 +121,7 @@ class TCPDF_IMAGES {
|
||||||
*/
|
*/
|
||||||
public static function _toPNG($image, $tempfile) {
|
public static function _toPNG($image, $tempfile) {
|
||||||
// turn off interlaced mode
|
// turn off interlaced mode
|
||||||
\imageinterlace($image, 0);
|
\imageinterlace($image, null);
|
||||||
// create temporary PNG image
|
// create temporary PNG image
|
||||||
\imagepng($image, $tempfile);
|
\imagepng($image, $tempfile);
|
||||||
// remove image from memory
|
// remove image from memory
|
||||||
|
|
@ -136,7 +136,7 @@ class TCPDF_IMAGES {
|
||||||
/**
|
/**
|
||||||
* Convert the loaded image to a JPEG and then return a structure for the PDF creator.
|
* 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.
|
* This function requires GD library and write access to the directory defined on K_PATH_CACHE constant.
|
||||||
* @param resource $image image object
|
* @param \GdImage $image image object
|
||||||
* @param int $quality JPEG quality
|
* @param int $quality JPEG quality
|
||||||
* @param string $tempfile Temporary file name.
|
* @param string $tempfile Temporary file name.
|
||||||
* return array|false image JPEG image object.
|
* return array|false image JPEG image object.
|
||||||
|
|
|
||||||
|
|
@ -7044,8 +7044,8 @@ class TCPDF {
|
||||||
// fit the image on available space
|
// fit the image on available space
|
||||||
list($w, $h, $x, $y) = $this->fitBlock($w, $h, $x, $y, $fitonpage);
|
list($w, $h, $x, $y) = $this->fitBlock($w, $h, $x, $y, $fitonpage);
|
||||||
// calculate new minimum dimensions in pixels
|
// calculate new minimum dimensions in pixels
|
||||||
$neww = \round($w * $this->k * $dpi / $this->dpi);
|
$neww = (int) \round($w * $this->k * $dpi / $this->dpi);
|
||||||
$newh = \round($h * $this->k * $dpi / $this->dpi);
|
$newh = (int) \round($h * $this->k * $dpi / $this->dpi);
|
||||||
// check if resize is necessary (resize is used only to reduce the image)
|
// check if resize is necessary (resize is used only to reduce the image)
|
||||||
$newsize = ($neww * $newh);
|
$newsize = ($neww * $newh);
|
||||||
$pixsize = ($pixw * $pixh);
|
$pixsize = ($pixw * $pixh);
|
||||||
|
|
@ -7957,11 +7957,11 @@ class TCPDF {
|
||||||
$ratio = \preg_replace('/[^0-9\.]/', '', $ratio);
|
$ratio = \preg_replace('/[^0-9\.]/', '', $ratio);
|
||||||
$ratio = (float) $ratio;
|
$ratio = (float) $ratio;
|
||||||
if ($type == 'u') {
|
if ($type == 'u') {
|
||||||
$chrdiff = \floor(($diff + 12) * $ratio);
|
$chrdiff = (int) \floor(($diff + 12) * $ratio);
|
||||||
$shift = \str_repeat(' ', $chrdiff);
|
$shift = \str_repeat(' ', $chrdiff);
|
||||||
$shift = TCPDF_FONTS::UTF8ToUTF16BE($shift, false, $this->isunicode, $this->CurrentFont);
|
$shift = TCPDF_FONTS::UTF8ToUTF16BE($shift, false, $this->isunicode, $this->CurrentFont);
|
||||||
} else {
|
} else {
|
||||||
$chrdiff = \floor(($diff + 11) * $ratio);
|
$chrdiff = (int) \floor(($diff + 11) * $ratio);
|
||||||
$shift = \str_repeat(' ', $chrdiff);
|
$shift = \str_repeat(' ', $chrdiff);
|
||||||
}
|
}
|
||||||
$page = \str_replace($aa, $shift, $page);
|
$page = \str_replace($aa, $shift, $page);
|
||||||
|
|
@ -15655,7 +15655,7 @@ class TCPDF {
|
||||||
$gvars = $this->getGraphicVars();
|
$gvars = $this->getGraphicVars();
|
||||||
// create new barcode object
|
// create new barcode object
|
||||||
$barcodeobj = new TCPDF2DBarcode($code, $type);
|
$barcodeobj = new TCPDF2DBarcode($code, $type);
|
||||||
$arrcode = $barcodeobj->getBarcodeArrayArray();
|
$arrcode = $barcodeobj->getBarcodeArray();
|
||||||
if (empty($arrcode) || !isset($arrcode['num_rows']) || ($arrcode['num_rows'] == 0) || !isset($arrcode['num_cols']) || ($arrcode['num_cols'] == 0)) {
|
if (empty($arrcode) || !isset($arrcode['num_rows']) || ($arrcode['num_rows'] == 0) || !isset($arrcode['num_cols']) || ($arrcode['num_cols'] == 0)) {
|
||||||
$this->Error('Error in 2D barcode string');
|
$this->Error('Error in 2D barcode string');
|
||||||
}
|
}
|
||||||
|
|
@ -18035,7 +18035,7 @@ Putting 1 is equivalent to putting 0 and calling Ln() just after. Default value:
|
||||||
$newpmid = '[('.\str_replace(\chr(0).\chr(32), ') '.\sprintf('%F', $spacew).' (', $replace).')]';
|
$newpmid = '[('.\str_replace(\chr(0).\chr(32), ') '.\sprintf('%F', $spacew).' (', $replace).')]';
|
||||||
$pos = \strpos($pmid, $pmatch, $pos);
|
$pos = \strpos($pmid, $pmatch, $pos);
|
||||||
if ($pos !== false) {
|
if ($pos !== false) {
|
||||||
$pmid = sub\str_replace($pmid, $newpmid, $pos, \strlen($pmatch));
|
$pmid = \substr_replace($pmid, $newpmid, $pos, \strlen($pmatch));
|
||||||
}
|
}
|
||||||
++$pos;
|
++$pos;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user