{"record":{"id":"d719386cf5fd471c","repo":"coollabsio/coolify","slug":"imagemagick-or-gd-is-required-to-process-profile-p","errorCode":null,"errorMessage":"ImageMagick or GD is required to process profile pictures that were not compressed by the browser.","messagePattern":"ImageMagick or GD is required to process profile pictures that were not compressed by the browser\\.","errorType":"exception","errorClass":"RuntimeException","httpStatus":null,"severity":"error","filePath":"app/Services/AvatarStorageService.php","lineNumber":109,"sourceCode":"\n        if (extension_loaded('imagick')) {\n            $image = new \\Imagick($upload->getRealPath());\n            $image->setIteratorIndex(0);\n            $image->autoOrient();\n            $image->cropThumbnailImage(256, 256);\n            $image->stripImage();\n            $image->setImageBackgroundColor('white');\n            $image = $image->mergeImageLayers(\\Imagick::LAYERMETHOD_FLATTEN);\n            $image->setImageFormat('jpeg');\n            $image->setImageCompressionQuality(80);\n            $contents = $image->getImagesBlob();\n            $image->clear();\n\n            return $contents;\n        }\n\n        if (! function_exists('imagecreatefromstring') || ! function_exists('imagejpeg')) {\n            throw new RuntimeException('ImageMagick or GD is required to process profile pictures that were not compressed by the browser.');\n        }\n\n        $source = imagecreatefromstring(file_get_contents($upload->getRealPath()));\n        if (! $source) {\n            throw new RuntimeException('Unable to read the uploaded profile picture.');\n        }\n\n        $sourceWidth = imagesx($source);\n        $sourceHeight = imagesy($source);\n        $cropSize = min($sourceWidth, $sourceHeight);\n        $target = imagecreatetruecolor(256, 256);\n        imagefill($target, 0, 0, imagecolorallocate($target, 255, 255, 255));\n        imagecopyresampled(\n            $target,\n            $source,\n            0,\n            0,\n            (int) (($sourceWidth - $cropSize) / 2),","sourceCodeStart":91,"sourceCodeEnd":127,"githubUrl":"https://github.com/coollabsio/coolify/blob/70b9acc42467278373e00de77abb40684e25b395/app/Services/AvatarStorageService.php#L91-L127","documentation":"Error \"ImageMagick or GD is required to process profile pictures that were not compressed by the browser.\" thrown in coollabsio/coolify.","triggerScenarios":"Thrown at app/Services/AvatarStorageService.php:109 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":"70b9acc42467278373e00de77abb40684e25b395","analyzedAt":"2026-08-17T01:41:01.313Z","schemaVersion":2},"datasetVersion":"2026-08-17T04:17:16.089Z"}