function TestToolkit::parseFile

Same name and namespace in other branches
  1. 9 core/modules/system/tests/modules/image_test/src/Plugin/ImageToolkit/TestToolkit.php \Drupal\image_test\Plugin\ImageToolkit\TestToolkit::parseFile()
  2. 8.9.x core/modules/system/tests/modules/image_test/src/Plugin/ImageToolkit/TestToolkit.php \Drupal\image_test\Plugin\ImageToolkit\TestToolkit::parseFile()
  3. 11.x core/modules/system/tests/modules/image_test/src/Plugin/ImageToolkit/TestToolkit.php \Drupal\image_test\Plugin\ImageToolkit\TestToolkit::parseFile()

Overrides ImageToolkitInterface::parseFile

File

core/modules/system/tests/modules/image_test/src/Plugin/ImageToolkit/TestToolkit.php, line 134

Class

TestToolkit
Defines a Test toolkit for image manipulation within Drupal.

Namespace

Drupal\image_test\Plugin\ImageToolkit

Code

public function parseFile() {
    $this->logCall('parseFile', func_get_args());
    $data = @getimagesize($this->getSource());
    if ($data && in_array($data[2], static::supportedTypes())) {
        $this->setType($data[2]);
        $this->width = $data[0];
        $this->height = $data[1];
        return TRUE;
    }
    return FALSE;
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.