{"record":{"id":"bbb1db80a4612b9f","repo":"phacility/phabricator","slug":"refusing-to-assess-image-dimensions-of-file-chunk","errorCode":null,"errorMessage":"Refusing to assess image dimensions of file chunk.","messagePattern":"Refusing to assess image dimensions of file chunk\\.","errorType":"exception","errorClass":"Exception","httpStatus":null,"severity":"error","filePath":"src/applications/files/storage/PhabricatorFile.php","lineNumber":1106,"sourceCode":"\n    foreach ($iterator as $chunk) {\n      $result .= $chunk;\n    }\n\n    return $result;\n  }\n\n  public function updateDimensions($save = true) {\n    if (!$this->isViewableImage()) {\n      throw new Exception(pht('This file is not a viewable image.'));\n    }\n\n    if (!function_exists('imagecreatefromstring')) {\n      throw new Exception(pht('Cannot retrieve image information.'));\n    }\n\n    if ($this->getIsChunk()) {\n      throw new Exception(\n        pht('Refusing to assess image dimensions of file chunk.'));\n    }\n\n    $engine = $this->instantiateStorageEngine();\n    if ($engine->isChunkEngine()) {\n      throw new Exception(\n        pht('Refusing to assess image dimensions of chunked file.'));\n    }\n\n    $data = $this->loadFileData();\n\n    $img = @imagecreatefromstring($data);\n    if ($img === false) {\n      throw new Exception(pht('Error when decoding image.'));\n    }\n\n    $this->metadata[self::METADATA_IMAGE_WIDTH] = imagesx($img);\n    $this->metadata[self::METADATA_IMAGE_HEIGHT] = imagesy($img);","sourceCodeStart":1088,"sourceCodeEnd":1124,"githubUrl":"https://github.com/phacility/phabricator/blob/5720a38cfe95b00ca4be5016dd0d2f3195f4fa04/src/applications/files/storage/PhabricatorFile.php#L1088-L1124","documentation":"Error \"Refusing to assess image dimensions of file chunk.\" thrown in phacility/phabricator.","triggerScenarios":"Thrown at src/applications/files/storage/PhabricatorFile.php:1106 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"5720a38cfe95b00ca4be5016dd0d2f3195f4fa04","analyzedAt":"2026-08-21T05:07:25.672Z","schemaVersion":2},"datasetVersion":"2026-08-21T11:28:35.574Z"}