{"record":{"id":"3c936a957141d93f","repo":"Intervention/image","slug":"no-icc-profile-found-in-image","errorCode":null,"errorMessage":"No ICC profile found in image","messagePattern":"No ICC profile found in image","errorType":"exception","errorClass":"Intervention\\Image\\Exceptions\\AnalyzerException","httpStatus":null,"severity":"warning","filePath":"src/Drivers/Imagick/Analyzers/ProfileAnalyzer.php","lineNumber":27,"sourceCode":"use Intervention\\Image\\Exceptions\\AnalyzerException;\nuse Intervention\\Image\\Exceptions\\StreamException;\nuse Intervention\\Image\\Exceptions\\InvalidArgumentException;\nuse Intervention\\Image\\Interfaces\\ImageInterface;\nuse Intervention\\Image\\Interfaces\\SpecializedInterface;\n\nclass ProfileAnalyzer extends GenericProfileAnalyzer implements SpecializedInterface\n{\n    /**\n     * @throws InvalidArgumentException\n     * @throws StreamException\n     * @throws AnalyzerException\n     */\n    public function analyze(ImageInterface $image): mixed\n    {\n        $profiles = $image->core()->native()->getImageProfiles('icc');\n\n        if (!array_key_exists('icc', $profiles)) {\n            throw new AnalyzerException('No ICC profile found in image');\n        }\n\n        return new Profile($profiles['icc']);\n    }\n}\n","sourceCodeStart":9,"sourceCodeEnd":33,"githubUrl":"https://github.com/Intervention/image/blob/5598b9e39751c34afc5cdee84abef77f92c26f68/src/Drivers/Imagick/Analyzers/ProfileAnalyzer.php#L9-L33","documentation":"$image->profile() returns the embedded ICC color profile; this AnalyzerException states that the image contains no 'icc' entry in its ImageMagick profile store. The large majority of web images — palette PNGs, screenshots, and JPEGs saved without an embedded profile — carry none, so this is a normal file state to expect rather than a processing defect.","triggerScenarios":"Calling $image->profile() on PNG/WebP screenshots, files run through metadata-stripping tools or optimized outputs (tinypng-like), or any asset color-managed implicitly (sRGB assumed) instead of via an embedded ICC chunk.","commonSituations":"Pipelines that copy the ICC profile from an upload to its processed derivative; assuming every JPEG has a profile when many camera files only carry EXIF colorspace hints.","solutions":["Treat 'no profile' as an expected branch: catch AnalyzerException and fall back to a stock sRGB profile loaded with Profile::fromPath().","When color fidelity matters, attach a known sRGB profile to the image before processing instead of reading one.","For Imagick pipelines, pre-check the profile store via $image->core()->native()->getImageProfiles('icc') to branch without exceptions."],"exampleFix":"// before\n$profile = $image->profile(); // throws for profile-less PNGs\n\n// after: fall back to a stock sRGB profile\ntry {\n    $profile = $image->profile();\n} catch (\\Intervention\\Image\\Exceptions\\AnalyzerException) {\n    $profile = \\Intervention\\Image\\Colors\\Profile::fromPath('sRGB.icc');\n}","handlingStrategy":"try-catch","validationCode":"// Imagick driver: check the profile store before calling profile()\n$profiles = $image->core()->native()->getImageProfiles('icc');\n$profile = array_key_exists('icc', $profiles)\n    ? $image->profile()\n    : \\Intervention\\Image\\Colors\\Profile::fromPath('sRGB.icc');","typeGuard":null,"tryCatchPattern":"try { $profile = $image->profile(); } catch (\\Intervention\\Image\\Exceptions\\AnalyzerException) { $profile = \\Intervention\\Image\\Colors\\Profile::fromPath('sRGB.icc'); }","preventionTips":["Assume web PNGs and optimized assets carry no ICC profile.","Check the profile store via the native Imagick object to branch without exceptions.","Keep a stock sRGB profile file alongside your app for fallback."],"tags":["imagick","icc-profile","metadata","color-management"],"backgroundTag":"missing-icc-profile","analyzedSha":"5598b9e39751c34afc5cdee84abef77f92c26f68","analyzedAt":"2026-08-23T02:17:31.068Z","schemaVersion":2},"datasetVersion":"2026-08-23T08:06:27.607Z"}