src/GuillermoMartinez/Filemanager/Filemanager.php
public function createThumb($file,$path){
        $ext = $file->getExtension();
        $search = $this->config["images"]["images_ext"];
        if(array_search($ext, $search) !== false){
            $fullpath = $this->getFullPath().$path;
            $fullpaththumb = $this->getFullPath().'/'.$this->config['folder_thumb'].$path;
            $filename = $file->getFilename();
            $filename_new_first = '';
            $i=0;
            foreach ($this->config['images']['resize'] as $key => $value) {
                $i++;
                $image_info = $this->imageSizeName($path,$filename,$value);
                if(file_exists($fullpaththumb.$image_info['name']) === false){
                    $this->resizeImage($fullpath.$filename,$fullpaththumb.$image_info['name'],$image_info,$value);
                }
                if($i==1) $filename_new_first = $image_info['name'];
            }
            return $filename_new_first;
        }else{
            if( $this->config['debug'] ) $this->_log(__METHOD__." - $ext");
        }
    }
public function createThumb($file,$path){
        $ext = $file->getExtension();
        $search = $this->config["images"]["images_ext"];
        if(array_search($ext, $search) !== false){
            $fullpath = $this->getFullPath().$path;
            $fullpaththumb = $this->getFullPath().'/'.$this->config['folder_thumb'].$path;
            $filename = $file->getFilename();
            $filename_new_first = '';
            $i=0;
            foreach ($this->config['images']['resize'] as $key => $value) {
                $i++;
                $image_info = $this->imageSizeName($path,$filename,$value);
                if(file_exists($fullpaththumb.$image_info['name']) === false){
                    $this->resizeImage($fullpath.$filename,$fullpaththumb.$image_info['name'],$image_info,$value);
                }
                if($i==1) $filename_new_first = $image_info['name'];
            }
            return $filename_new_first;
        }else{
            if( $this->config['debug'] ) $this->_log(__METHOD__." - $ext");
        }
    }
public function createThumb ( $ file , $ path ) { $ ext = $ file -> getExtension ( ) ; $ search = $ this -> config [ "images" ] [ "images_ext" ] ; if ( array_search ( $ ext , $ search ) !== false ) { $ fullpath = $ this -> getFullPath ( ) . $ path ; $ fullpaththumb = $ this -> getFullPath ( ) . '/' . $ this -> config [ 'folder_thumb' ] . $ path ; $ filename = $ file -> getFilename ( ) ; $ filename_new_first = '' ; $ i = 0 ; foreach ( $ this -> config [ 'images' ] [ 'resize' ] as $ key => $ value ) { $ i ++ ; $ image_info = $ this -> imageSizeName ( $ path , $ filename , $ value ) ; if ( file_exists ( $ fullpaththumb . $ image_info [ 'name' ] ) === false ) { $ this -> resizeImage ( $ fullpath . $ filename , $ fullpaththumb . $ image_info [ 'name' ] , $ image_info , $ value ) ; } if ( $ i == 1 ) $ filename_new_first = $ image_info [ 'name' ] ; } return $ filename_new_first ; } else { if ( $ this -> config [ 'debug' ] ) $ this -> _log ( __METHOD__ . " - $ext" ) ; } }
Crea la miniatura de imagenes
@param UploadedFile $file
@param string $path
@return string Nombre del nuevo archivo
Crea la miniatura de imagenes