Server IP : 195.201.23.43 / Your IP : 18.117.82.179 Web Server : Apache System : Linux webserver2.vercom.be 5.4.0-192-generic #212-Ubuntu SMP Fri Jul 5 09:47:39 UTC 2024 x86_64 User : kdecoratie ( 1041) PHP Version : 7.1.33-63+ubuntu20.04.1+deb.sury.org+1 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, MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : ON Directory : /home/kdecoratie/public_html/administrator/components/com_admirorgallery/scripts/ |
Upload File : |
<?php //SecureImage v0.3 by Mesut Timur //contact : mesut@h-labs.org //date : 03/2008 class SecureImage { //private vars var $_file; var $_image; var $_extension; //constructor function __construct($file_) { $this->_file = $file_; // Get extension $this->_extension = strrchr($this->_file, '.'); $this->_extension = strtolower($this->_extension); } //check routine function checkIt() { //if it can be opened $this->_image=$this->_openImage($this->_file); if($this->_image==false) return false; //removing EXIF $this->_convert(); return true; } function _openImage($file) { switch($this->_extension) { case '.jpg': case '.jpeg': $im = @imagecreatefromjpeg($this->_file); break; case '.gif': $im = @imagecreatefromgif($this->_file); break; case '.png': $im=@imagecreatefrompng($this->_file); break; default: $im = false; break; } return $im; } function _convert() { switch($this->_extension) { case '.jpg': case '.jpeg': imagegif($this->_image, $this->_file); imagejpeg($this->_image, $this->_file); $this->_jpgclean("clean.tmp"); rename("clean.tmp",$this->_file); break; case '.gif': imagejpeg($this->_image, $this->_file); imagegif($this->_image, $this->_file); break; case '.png': imagejpeg($this->_image, $this->_file); imagepng($this->_image, $this->_file); break; default: die("Bir Terslik Var"); } } function _jpgclean($destination, $erstellen = TRUE) { //by Robert Beran //webmaster@robert-beran.de $handle = fopen($this->_file, "rb"); $segment[] = fread($handle, 2); if($segment[0] === "\xFF\xD8") { $segment[] = fread($handle, 1); if($segment[1] === "\xFF") { rewind ($handle); while(!feof($handle)) { $daten = fread($handle, 2); if( (preg_match("/FFE[1-9a-zA-Z]{1,1}/i",bin2hex($daten))) || ($daten === "\xFF\xFE") ) { $position = ftell($handle); $size = fread($handle, 2); $newsize = 256 * ord($size{0}) + ord($size{1}); $newpos = $position + $newsize; fseek($handle, $newpos); } else { $newfile[] = $daten; } } fclose($handle); $newfile = implode('',$newfile); if($erstellen === TRUE) { $handle = fopen($destination, "wb"); fwrite($handle, $newfile); fclose($handle); return TRUE; } else { return $newfile; } } else { return FALSE; } } else { return FALSE; } } } ?>Private