src/app/helpers/HCImageThumbs.php
public function generate(string $resourceId, string $thumbId, $quality = 100)
    {
        $setting = $this->getThumbSettings($thumbId);

        $this->setThumbFolderName($setting);

        $resource = $this->getResource($resourceId);

        $file = $this->getOriginalFile($resource);

        if( $file ) {
            $image = $this->resizeImage($file, $setting);
//            $image = $this->addWatermark($image, $setting);
            $image->encode('jpg', $quality);
            $image->save($this->getLocation($resource));
        }
    }
public function generate(string $resourceId, string $thumbId, $quality = 100)
    {
        $setting = $this->getThumbSettings($thumbId);

        $this->setThumbFolderName($setting);

        $resource = $this->getResource($resourceId);

        $file = $this->getOriginalFile($resource);

        if( $file ) {
            $image = $this->resizeImage($file, $setting);
//            $image = $this->addWatermark($image, $setting);
            $image->encode('jpg', $quality);
            $image->save($this->getLocation($resource));
        }
    }
public function generate ( string $ resourceId , string $ thumbId , $ quality = 100 ) { $ setting = $ this -> getThumbSettings ( $ thumbId ) ; $ this -> setThumbFolderName ( $ setting ) ; $ resource = $ this -> getResource ( $ resourceId ) ; $ file = $ this -> getOriginalFile ( $ resource ) ; if ( $ file ) { $ image = $ this -> resizeImage ( $ file , $ setting ) ; //            $image = $this->addWatermark($image, $setting); $ image -> encode ( 'jpg' , $ quality ) ; $ image -> save ( $ this -> getLocation ( $ resource ) ) ; } }
Generate thumb by given params

@param string $resourceId
@param string $thumbId
@param int $quality
Generate thumb by given params