ÿØÿà JFIF ÿþ; %PDF-1.5 %���� ºaâÚÎΞ-ÌE1ÍØÄ÷{òò2ÿ ÛÖ^ÔÀá TÎ{¦?§®¥kuµùÕ5sLOšuY
Server IP : 157.90.209.209 / Your IP : 216.73.216.148 [ Web Server : Apache System : Linux hcomm124.dns-wk.info 4.18.0-553.64.1.el8_10.x86_64 #1 SMP Mon Jul 28 12:01:56 EDT 2025 x86_64 User : evidenciarevista ( 1049) PHP Version : 7.2.34 Disable Function : exec,passthru,shell_exec,system Domains : 216 Domains MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : ON Directory : /home/evidenciarevista/admin/vendor/intervention/image/src/Intervention/Image/Gd/ |
Upload File : |
<?php namespace Intervention\Image\Gd; use Intervention\Image\Image; class Decoder extends \Intervention\Image\AbstractDecoder { /** * Initiates new image from path in filesystem * * @param string $path * @return \Intervention\Image\Image */ public function initFromPath($path) { $info = @getimagesize($path); if ($info === false) { throw new \Intervention\Image\Exception\NotReadableException( "Unable to read image from file ({$path})." ); } // define core switch ($info[2]) { case IMAGETYPE_PNG: $core = @imagecreatefrompng($path); break; case IMAGETYPE_JPEG: $core = @imagecreatefromjpeg($path); break; case IMAGETYPE_GIF: $core = @imagecreatefromgif($path); break; default: throw new \Intervention\Image\Exception\NotReadableException( "Unable to read image type. GD driver is only able to decode JPG, PNG or GIF files." ); } if ($core === false) { throw new \Intervention\Image\Exception\NotReadableException( "Unable to read image from file ({$path})." ); } $this->gdResourceToTruecolor($core); // build image $image = $this->initFromGdResource($core); $image->mime = $info['mime']; $image->setFileInfoFromPath($path); return $image; } /** * Initiates new image from GD resource * * @param Resource $resource * @return \Intervention\Image\Image */ public function initFromGdResource($resource) { return new Image(new Driver, $resource); } /** * Initiates new image from Imagick object * * @param Imagick $object * @return \Intervention\Image\Image */ public function initFromImagick(\Imagick $object) { throw new \Intervention\Image\Exception\NotSupportedException( "Gd driver is unable to init from Imagick object." ); } /** * Initiates new image from binary data * * @param string $data * @return \Intervention\Image\Image */ public function initFromBinary($binary) { $resource = @imagecreatefromstring($binary); if ($resource === false) { throw new \Intervention\Image\Exception\NotReadableException( "Unable to init from given binary data." ); } $image = $this->initFromGdResource($resource); $image->mime = finfo_buffer(finfo_open(FILEINFO_MIME_TYPE), $binary); return $image; } /** * Transform GD resource into Truecolor version * * @param resource $resource * @return bool */ public function gdResourceToTruecolor(&$resource) { $width = imagesx($resource); $height = imagesy($resource); // new canvas $canvas = imagecreatetruecolor($width, $height); // fill with transparent color imagealphablending($canvas, false); $transparent = imagecolorallocatealpha($canvas, 255, 255, 255, 127); imagefilledrectangle($canvas, 0, 0, $width, $height, $transparent); imagecolortransparent($canvas, $transparent); imagealphablending($canvas, true); // copy original imagecopy($canvas, $resource, 0, 0, 0, 0, $width, $height); imagedestroy($resource); $resource = $canvas; return true; } }