Welcome Guest, Not a member yet? Register   Sign In
in service:: image this method does not work !!! ??? convert()
#1

(This post was last modified: 01-25-2024, 09:45 PM by luckmoshy.)

Hi, Ci I think @kenjis one day if I am not mistaken promised to solve this issue at the next CI upgrade but till now is not been working why is it forgotten? or is there another way!!!

PHP Code:
$this->sizeImage =  \Config\Services::image(); 

PHP Code:
//does not work at all
  if($file->isValid() && ! $file->hasMoved()) {          
 
            $this
->sizeImage->withFile($file)
 ->
convert(IMAGETYPE_WEBP)
            ->fit(700,450,true,'center')
            ->save(FCPATH .'/upload/'.
 
$save $file->getRandomName()); 
          

but have used my way to generate and is working

like this


PHP Code:
//Here is working....
  if($file->isValid() && ! $file->hasMoved()) {          
 
            $this
->sizeImage->withFile($file)
 
//->convert(IMAGETYPE_WEBP)
            ->fit(700,450,true,'center')
            ->save(FCPATH .'/upload/'.
 
$save str_ireplace(['.jpg','.png','.jpeg'],'.webp',$file->getRandomName()); 
          
Codeigniter First, Codeigniter Then You!!
yekrinaDigitals

Reply


Messages In This Thread
in service:: image this method does not work !!! ??? convert() - by luckmoshy - 01-25-2024, 09:40 PM



Theme © iAndrew 2016 - Forum software by © MyBB