{"record":{"id":"e8f318892e024859","repo":"Intervention/image","slug":"invalid-target-size-width-x-height","errorCode":null,"errorMessage":"Invalid target size {$width}x{$height}","messagePattern":"Invalid target size (.+?)x(.+?)","errorType":"exception","errorClass":"Intervention\\Image\\Exceptions\\InvalidArgumentException","httpStatus":null,"severity":"error","filePath":"src/Geometry/Rectangle.php","lineNumber":341,"sourceCode":"            $this->pivot()->x() - $rectangle->pivot()->x(),\n            $this->pivot()->y() - $rectangle->pivot()->y(),\n        );\n    }\n\n    /**\n     * {@inheritdoc}\n     *\n     * @deprecated Use Intervention\\Image\\Size::class instead.\n     * @see SizeInterface::resize()\n     *\n     * @throws InvalidArgumentException\n     */\n    public function resize(?int $width = null, ?int $height = null): SizeInterface\n    {\n        try {\n            return $this->resizer($width, $height)->resize($this);\n        } catch (InvalidArgumentException $e) {\n            throw new InvalidArgumentException(\n                'Invalid target size ' . $width . 'x' . $height,\n                previous: $e,\n            );\n        }\n    }\n\n    /**\n     * {@inheritdoc}\n     *\n     * @deprecated Use Intervention\\Image\\Size::class instead.\n     * @see SizeInterface::resizeDown()\n     *\n     * @throws InvalidArgumentException\n     */\n    public function resizeDown(?int $width = null, ?int $height = null): SizeInterface\n    {\n        try {\n            return $this->resizer($width, $height)->resizeDown($this);","sourceCodeStart":323,"sourceCodeEnd":359,"githubUrl":"https://github.com/Intervention/image/blob/5598b9e39751c34afc5cdee84abef77f92c26f68/src/Geometry/Rectangle.php#L323-L359","documentation":"Error \"Invalid target size {$width}x{$height}\" thrown in Intervention/image.","triggerScenarios":"Thrown at src/Geometry/Rectangle.php:341 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Pass a target size with positive width and height; both must be >= 1","Check upstream calculations producing $width/$height so they cannot yield 0 or negative values","Validate user-supplied resize dimensions before calling size-related geometry methods"],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"5598b9e39751c34afc5cdee84abef77f92c26f68","analyzedAt":"2026-08-23T02:17:31.068Z","schemaVersion":2},"datasetVersion":"2026-08-23T08:06:27.607Z"}