phacility/phabricator · error · Exception

Cannot retrieve image information.

Error message

Cannot retrieve image information.

What it means

Capability guard in updateDimensions: the GD function imagecreatefromstring() does not exist, i.e. the GD extension is not installed/enabled, so image information cannot be retrieved regardless of the file.

Solutions

  1. Install or enable the PHP GD extension and restart PHP
  2. Avoid invoking image operations on installs without GD
Defensive patterns

Strategy: type-guard

When it happens

Trigger: Thrown at src/applications/files/storage/PhabricatorFile.php:1102 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of phacility/phabricator@5720a38cfe (2026-08-21). Data as JSON: /api/errors/d7e734360178987c. Report an issue: GitHub.

Appendix: source

Thrown at src/applications/files/storage/PhabricatorFile.php:1102

  }

  public function loadDataFromIterator($iterator) {
    $result = '';

    foreach ($iterator as $chunk) {
      $result .= $chunk;
    }

    return $result;
  }

  public function updateDimensions($save = true) {
    if (!$this->isViewableImage()) {
      throw new Exception(pht('This file is not a viewable image.'));
    }

    if (!function_exists('imagecreatefromstring')) {
      throw new Exception(pht('Cannot retrieve image information.'));
    }

    if ($this->getIsChunk()) {
      throw new Exception(
        pht('Refusing to assess image dimensions of file chunk.'));
    }

    $engine = $this->instantiateStorageEngine();
    if ($engine->isChunkEngine()) {
      throw new Exception(
        pht('Refusing to assess image dimensions of chunked file.'));
    }

    $data = $this->loadFileData();

    $img = @imagecreatefromstring($data);
    if ($img === false) {
      throw new Exception(pht('Error when decoding image.'));

View on GitHub (pinned to 5720a38cfe)