@php $brasaoSrc = null; $brasaoPath = public_path('brasao.png'); $embeddedWidth = 240; if (is_file($brasaoPath) && function_exists('imagecreatefrompng')) { $sourceImage = imagecreatefrompng($brasaoPath); if ($sourceImage !== false) { $sourceWidth = imagesx($sourceImage); $sourceHeight = imagesy($sourceImage); $targetWidth = $embeddedWidth; $targetHeight = max(1, (int) round(($sourceHeight / max(1, $sourceWidth)) * $targetWidth)); $resizedImage = imagecreatetruecolor($targetWidth, $targetHeight); imagealphablending($resizedImage, false); imagesavealpha($resizedImage, true); imagecopyresampled( $resizedImage, $sourceImage, 0, 0, 0, 0, $targetWidth, $targetHeight, $sourceWidth, $sourceHeight ); ob_start(); imagepng($resizedImage); $brasaoSrc = 'data:image/png;base64,' . base64_encode((string) ob_get_clean()); imagedestroy($resizedImage); imagedestroy($sourceImage); } } @endphp
|
@if ($brasaoSrc)
|
Administracao Municipal {{ $nomeEntidade->municipio ?? '' }}{{ $nomeEntidade->nome_prefeito ?? '' }} |