{"record":{"id":"9e4d79f3b39ed8bb","repo":"getgrav/grav","slug":"you-need-to-exif-php-extension-to-use-this-functio","errorCode":null,"errorMessage":"You need to EXIF PHP Extension to use this function","messagePattern":"You need to EXIF PHP Extension to use this function","errorType":"exception","errorClass":"RuntimeException","httpStatus":null,"severity":"error","filePath":"system/src/Grav/Common/Page/Medium/ImageFile.php","lineNumber":200,"sourceCode":"\n        $data = [\n            $inputInfos,\n            $this->serializeOperations(),\n            $type,\n            $quality,\n            $extras\n        ];\n\n        $this->hash = sha1(serialize($data));\n    }\n\n    /**\n     * Read exif rotation from file and apply it.\n     */\n    public function fixOrientation()\n    {\n        if (!extension_loaded('exif')) {\n            throw new RuntimeException('You need to EXIF PHP Extension to use this function');\n        }\n\n        if (!file_exists($this->source->getInfos()) || !in_array(exif_imagetype($this->source->getInfos()), [IMAGETYPE_JPEG, IMAGETYPE_TIFF_II, IMAGETYPE_TIFF_MM], true)) {\n            return $this;\n        }\n\n        // resolve any streams\n        /** @var UniformResourceLocator $locator */\n        $locator = Grav::instance()['locator'];\n        $filepath = $this->source->getInfos();\n        if ($locator->isStream($filepath)) {\n            $filepath = $locator->findResource($this->source->getInfos(), true, true);\n        }\n\n        // Make sure file exists\n        if (!file_exists($filepath)) {\n            return $this;\n        }","sourceCodeStart":182,"sourceCodeEnd":218,"githubUrl":"https://github.com/getgrav/grav/blob/6040efed04efa69b8209448ed81308e7c24147c2/system/src/Grav/Common/Page/Medium/ImageFile.php#L182-L218","documentation":"Error \"You need to EXIF PHP Extension to use this function\" thrown in getgrav/grav.","triggerScenarios":"Thrown at system/src/Grav/Common/Page/Medium/ImageFile.php:200 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":"6040efed04efa69b8209448ed81308e7c24147c2","analyzedAt":"2026-08-17T05:07:31.593Z","schemaVersion":2},"datasetVersion":"2026-08-17T09:17:11.063Z"}