Skip to content

Commit

Permalink
Criado recurso para checar se a logo esta corrompida e ignore na cria…
Browse files Browse the repository at this point in the history
…ção do PDF.
  • Loading branch information
icompsoftcleiton committed May 3, 2024
1 parent 0813cad commit 26238de
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/Common/DaCommon.php
Original file line number Diff line number Diff line change
Expand Up @@ -294,13 +294,19 @@ protected function adjustImage($logo, $turn_bw = false)
}
if ($type == '3') { //3 = PNG
$image = imagecreatefrompng($logo);
if (!$image) {
return null;
}
if ($turn_bw) {
imagefilter($image, IMG_FILTER_GRAYSCALE);
//imagefilter($image, IMG_FILTER_CONTRAST, -100);
}
return $this->getImageStringFromObject($image);
} elseif ($type == '2' && $turn_bw) {
$image = imagecreatefromjpeg($logo);
if (!$image) {
return null;
}
imagefilter($image, IMG_FILTER_GRAYSCALE);
//imagefilter($image, IMG_FILTER_CONTRAST, -100);
return $this->getImageStringFromObject($image);
Expand Down

0 comments on commit 26238de

Please sign in to comment.