You are here

static function FileCommited::isTransparent in N1ED - Visual editor as CKEditor plugin with Bootstrap support 7

1 call to FileCommited::isTransparent()
FileCommited::addPaddingsToImageNative in vendor/edsdk/file-uploader-server-php/src/lib/file/FileCommited.php

File

vendor/edsdk/file-uploader-server-php/src/lib/file/FileCommited.php, line 272

Class

FileCommited

Namespace

EdSDK\FileUploaderServer\lib\file

Code

static function isTransparent($image) {
  $w = imagesx($image) - 1;
  $w2 = floor($w / 2.0);
  $h = imagesy($image) - 1;
  $h2 = floor($w / 2.0);
  if (FileCommited::isPixelTransparent($image, 0, 0)) {
    return true;
  }
  if (FileCommited::isPixelTransparent($image, $w, 0)) {
    return true;
  }
  if (FileCommited::isPixelTransparent($image, 0, $h)) {
    return true;
  }
  if (FileCommited::isPixelTransparent($image, $w, $h)) {
    return true;
  }
  if ($w2 != $w || $h2 != $h) {
    if (FileCommited::isPixelTransparent($image, $w2, 0)) {
      return true;
    }
    if (FileCommited::isPixelTransparent($image, $w, $h2)) {
      return true;
    }
    if (FileCommited::isPixelTransparent($image, $w2, $h)) {
      return true;
    }
    if (FileCommited::isPixelTransparent($image, 0, $h2)) {
      return true;
    }
  }
  return false;
}