����JFIF��H�H����Exif��MM�*���� ��3����V�����3������3�(��������������������3�����
Server IP : 74.208.127.88 / Your IP : 3.133.87.185 Web Server : Apache/2.4.41 (Ubuntu) System : Linux ubuntu 5.4.0-163-generic #180-Ubuntu SMP Tue Sep 5 13:21:23 UTC 2023 x86_64 User : www-data ( 33) PHP Version : 7.4.3-4ubuntu2.29 Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,pcntl_unshare, MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : ON Directory : /var/www/html/t/sae/appsae/imprimir/class/drawer/ |
Upload File : |
<?php /** *-------------------------------------------------------------------- * * Image Class to draw JPG images with possibility to set DPI * *-------------------------------------------------------------------- * Copyright (C) Jean-Sebastien Goupil * http://www.barcodephp.com */ include_once('BCGDraw.php'); if (!function_exists('file_put_contents')) { function file_put_contents($filename, $data) { $f = @fopen($filename, 'w'); if (!$f) { return false; } else { $bytes = fwrite($f, $data); fclose($f); return $bytes; } } } class BCGDrawJPG extends BCGDraw { private $dpi; private $quality; /** * Constructor. * * @param resource $im */ public function __construct($im) { parent::__construct($im); } /** * Sets the DPI. * * @param int $dpi */ public function setDPI($dpi) { if(is_int($dpi)) { $this->dpi = max(1, $dpi); } else { $this->dpi = null; } } /** * Sets the quality of the JPG. * * @param int $quality */ public function setQuality($quality) { $this->quality = $quality; } /** * Draws the JPG on the screen or in a file. */ public function draw() { ob_start(); imagejpeg($this->im, null, $this->quality); $bin = ob_get_contents(); ob_end_clean(); $this->setInternalProperties($bin); if (empty($this->filename)) { echo $bin; } else { file_put_contents($this->filename, $bin); } } private function setInternalProperties(&$bin) { $this->internalSetDPI($bin); $this->internalSetC($bin); } private function internalSetDPI(&$bin) { if ($this->dpi !== null) { $bin = substr_replace($bin, pack("Cnn", 0x01, $this->dpi, $this->dpi), 13, 5); } } private function internalSetC(&$bin) { if(strcmp(substr($bin, 0, 4), pack('H*', 'FFD8FFE0')) === 0) { $offset = 4 + (ord($bin[4]) << 8 | ord($bin[5])); $firstPart = substr($bin, 0, $offset); $secondPart = substr($bin, $offset); $cr = pack('H*', 'FFFE004447656E657261746564207769746820426172636F64652047656E657261746F7220666F722050485020687474703A2F2F7777772E626172636F64657068702E636F6D'); $bin = $firstPart; $bin .= $cr; $bin .= $secondPart; } } } ?>