From 472cd1c25b89ea0c483bffea817557f84cf9c8d7 Mon Sep 17 00:00:00 2001 From: Sergey Panteleev Date: Tue, 29 Oct 2024 18:08:52 +0300 Subject: [PATCH 1/2] [PHP 8.4] Add errors for GD functions --- reference/image/functions/imageavif.xml | 38 +++++++++++++++++++++++ reference/image/functions/imagefilter.xml | 18 +++++++++++ reference/image/functions/imagejpeg.xml | 13 ++++++++ reference/image/functions/imagepng.xml | 13 ++++++++ reference/image/functions/imagescale.xml | 22 +++++++++++++ reference/image/functions/imagewebp.xml | 13 ++++++++ 6 files changed, 117 insertions(+) diff --git a/reference/image/functions/imageavif.xml b/reference/image/functions/imageavif.xml index 2685896ba78d..bfc6d4f9c18c 100644 --- a/reference/image/functions/imageavif.xml +++ b/reference/image/functions/imageavif.xml @@ -63,6 +63,44 @@ &gd.return.trueonerror; + + &reftitle.errors; + + Throws a ValueError if quality is invalid. + + + Throws a ValueError if speed is invalid. + + + + + &reftitle.changelog; + + + + + &Version; + &Description; + + + + + 8.4.0 + + Now throws a ValueError if quality is invalid. + + + + 8.4.0 + + Now throws a ValueError if speed is invalid. + + + + + + + &reftitle.seealso; diff --git a/reference/image/functions/imagefilter.xml b/reference/image/functions/imagefilter.xml index e29b8a9b10e3..fb78408a6463 100644 --- a/reference/image/functions/imagefilter.xml +++ b/reference/image/functions/imagefilter.xml @@ -234,6 +234,16 @@ &return.success; + + + &reftitle.errors; + + Throws a ValueError + if sub or plus is over/underflow + with the IMG_FILTER_SCATTER filter. + + + &reftitle.changelog; @@ -246,6 +256,14 @@ + + 8.4.0 + + Now throws a ValueError + if sub or plus is over/underflow + with the IMG_FILTER_SCATTER filter. + + &gd.changelog.image-param; 7.4.0 diff --git a/reference/image/functions/imagejpeg.xml b/reference/image/functions/imagejpeg.xml index 46eb729f5cd7..b811358e1a18 100644 --- a/reference/image/functions/imagejpeg.xml +++ b/reference/image/functions/imagejpeg.xml @@ -50,6 +50,13 @@ &gd.return.trueonerror; + + &reftitle.errors; + + Throws a ValueError if quality is invalid. + + + &reftitle.changelog; @@ -61,6 +68,12 @@ + + 8.4.0 + + Now throws a ValueError if quality is invalid. + + &gd.changelog.image-param; diff --git a/reference/image/functions/imagepng.xml b/reference/image/functions/imagepng.xml index 0c7ff5e31e57..78189e92f004 100644 --- a/reference/image/functions/imagepng.xml +++ b/reference/image/functions/imagepng.xml @@ -75,6 +75,13 @@ &gd.return.trueonerror; + + &reftitle.errors; + + Throws a ValueError if quality is invalid. + + + &reftitle.changelog; @@ -86,6 +93,12 @@ + + 8.4.0 + + Now throws a ValueError if quality is invalid. + + &gd.changelog.image-param; diff --git a/reference/image/functions/imagescale.xml b/reference/image/functions/imagescale.xml index ce55588c6073..f98c46c82485 100644 --- a/reference/image/functions/imagescale.xml +++ b/reference/image/functions/imagescale.xml @@ -76,6 +76,16 @@ + + &reftitle.errors; + + Throws a ValueError if width or height is over/underflow. + + + Throws a ValueError if mode is invalid. + + + &reftitle.changelog; @@ -87,6 +97,18 @@ + + 8.4.0 + + Now throws a ValueError if width or height is over/underflow. + + + + 8.4.0 + + Now throws a ValueError if mode is invalid. + + 8.0.0 diff --git a/reference/image/functions/imagewebp.xml b/reference/image/functions/imagewebp.xml index 20c66be87551..ec4d28172756 100644 --- a/reference/image/functions/imagewebp.xml +++ b/reference/image/functions/imagewebp.xml @@ -51,6 +51,13 @@ &gd.return.trueonerror; + + &reftitle.errors; + + Throws a ValueError if quality is invalid. + + + &reftitle.changelog; @@ -62,6 +69,12 @@ + + 8.4.0 + + Now throws a ValueError if quality is invalid. + + &gd.changelog.image-param; From 1cbdad1daf097284ad329ab0a63b0995d7e16e2f Mon Sep 17 00:00:00 2001 From: Sergey Panteleev Date: Tue, 29 Oct 2024 18:29:22 +0300 Subject: [PATCH 2/2] Apply suggestions from code review Co-authored-by: Christoph M. Becker --- reference/image/functions/imageavif.xml | 15 ++++----------- reference/image/functions/imagefilter.xml | 4 ++-- reference/image/functions/imagescale.xml | 6 ++++-- 3 files changed, 10 insertions(+), 15 deletions(-) diff --git a/reference/image/functions/imageavif.xml b/reference/image/functions/imageavif.xml index bfc6d4f9c18c..db549fa7c956 100644 --- a/reference/image/functions/imageavif.xml +++ b/reference/image/functions/imageavif.xml @@ -66,10 +66,8 @@ &reftitle.errors; - Throws a ValueError if quality is invalid. - - - Throws a ValueError if speed is invalid. + Throws a ValueError if quality + or speed is invalid. @@ -87,13 +85,8 @@ 8.4.0 - Now throws a ValueError if quality is invalid. - - - - 8.4.0 - - Now throws a ValueError if speed is invalid. + Now throws a ValueError if quality + or speed is invalid. diff --git a/reference/image/functions/imagefilter.xml b/reference/image/functions/imagefilter.xml index fb78408a6463..9204acf7e1de 100644 --- a/reference/image/functions/imagefilter.xml +++ b/reference/image/functions/imagefilter.xml @@ -239,7 +239,7 @@ &reftitle.errors; Throws a ValueError - if sub or plus is over/underflow + if sub or plus would cause over-/underflow with the IMG_FILTER_SCATTER filter. @@ -260,7 +260,7 @@ 8.4.0 Now throws a ValueError - if sub or plus is over/underflow + if sub or plus would cause over-/underflow with the IMG_FILTER_SCATTER filter. diff --git a/reference/image/functions/imagescale.xml b/reference/image/functions/imagescale.xml index f98c46c82485..dd8dff982675 100644 --- a/reference/image/functions/imagescale.xml +++ b/reference/image/functions/imagescale.xml @@ -79,7 +79,8 @@ &reftitle.errors; - Throws a ValueError if width or height is over/underflow. + Throws a ValueError if width + or height would cause over-/underflow. Throws a ValueError if mode is invalid. @@ -100,7 +101,8 @@ 8.4.0 - Now throws a ValueError if width or height is over/underflow. + Now throws a ValueError if width + or height would cause over-/underflow.