{"record":{"id":"48731cefe634efca","repo":"phacility/phabricator","slug":"found-no-template-resource-for-emblem-s-with","errorCode":null,"errorMessage":"Found no template resource (for emblem \"%s\") with dimensions %dx%d.","messagePattern":"Found no template resource \\(for emblem \"(.+?)\"\\) with dimensions (.+?)x(.+?)\\.","errorType":"exception","errorClass":"Exception","httpStatus":null,"severity":"error","filePath":"src/applications/files/favicon/PhabricatorFaviconRef.php","lineNumber":401,"sourceCode":"      // Otherwise, we'd rather scale an image a little bit (ideally, zero)\n      // than scale an image a lot.\n      $width_score = abs($width_diff);\n\n      $scores[$key] = id(new PhutilSortVector())\n        ->addInt($default_score)\n        ->addInt($scale_score)\n        ->addInt($width_score);\n    }\n\n    if (!$scores) {\n      if ($emblem === null) {\n        throw new Exception(\n          pht(\n            'Found no background template resource for dimensions %dx%d.',\n            $width,\n            $height));\n      } else {\n        throw new Exception(\n          pht(\n            'Found no template resource (for emblem \"%s\") with dimensions '.\n            '%dx%d.',\n            $emblem,\n            $width,\n            $height));\n      }\n    }\n\n    $scores = msortv($scores, 'getSelf');\n    $best_score = head_key($scores);\n\n    $viewer = $this->getViewer();\n\n    $resource = $all_resources[$best_score];\n    if ($resource['source-type'] === 'builtin') {\n      $file = PhabricatorFile::loadBuiltin($viewer, $resource['source']);\n      if (!$file) {","sourceCodeStart":383,"sourceCodeEnd":419,"githubUrl":"https://github.com/phacility/phabricator/blob/5720a38cfe95b00ca4be5016dd0d2f3195f4fa04/src/applications/files/favicon/PhabricatorFaviconRef.php#L383-L419","documentation":"The emblem variant of the favicon template lookup: newTemplateFile() filters resources by emblem name and exact aspect ratio, and no resource for that emblem matched the requested width x height, leaving the score set empty. The requested emblem simply has no template registered at a usable size.","triggerScenarios":"Requesting a named emblem (e.g. a notification badge) at dimensions whose aspect ratio none of that emblem's templates share — usually custom emblem code or an emblem configuration that registered files at only one size while rendering asks for another.","commonSituations":"Custom emblem configurations uploading a single template image but rendering multiple favicon sizes; extensions adding emblems without full-size template coverage.","solutions":["Register template resources for that emblem covering the requested aspect ratio","Or render the emblem only at dimensions its existing templates already cover"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"$ratio = $width / $height;\n$covered = false;\nforeach (self::getAllResources() as $resource) {\n  if (idx($resource, 'emblem') !== $emblem) { continue; }\n  if (($resource['width'] / $resource['height']) === $ratio) { $covered = true; break; }\n}\nif (!$covered) { // skip the emblem at this size\n}","typeGuard":null,"tryCatchPattern":"catch Exception and render the plain background favicon without the emblem as a graceful degradation.","preventionTips":["Register emblem templates at every aspect ratio your renderer will request","Keep emblem name strings identical between config and template registration"],"tags":["favicon","emblem","rendering","resources"],"backgroundTag":"missing-template-resource","analyzedSha":"5720a38cfe95b00ca4be5016dd0d2f3195f4fa04","analyzedAt":"2026-08-21T05:07:25.672Z","schemaVersion":2},"datasetVersion":"2026-08-21T11:28:35.574Z"}