You are here

private function FileCommited::writeImage in N1ED - Visual editor as CKEditor plugin with Bootstrap support 8.2

Writes image to disc.

1 call to FileCommited::writeImage()
FileCommited::resizeImage in src/Flmngr/FileUploaderServer/lib/file/FileCommited.php
Resizes an image.

File

src/Flmngr/FileUploaderServer/lib/file/FileCommited.php, line 298

Class

FileCommited
Commited file (data structure about the file of finished upload transaction). Has method for resizing images (applying sizes when finishing transaction).

Namespace

Drupal\n1ed\Flmngr\FileUploaderServer\lib\file

Code

private function writeImage($image) {
  switch (strtolower($this
    ->getExt())) {
    case 'gif':
      imagegif($image, $this
        ->getFullPath());
      break;
    case 'jpeg':
    case 'jpg':
      imagejpeg($image, $this
        ->getFullPath(), $this->config
        ->getJpegQuality());
      break;
    case 'png':
      imagepng($image, $this
        ->getFullPath());
      break;
    case 'bmp':
      imagewbmp($image, $this
        ->getFullPath());
      break;
  }
}