Skip to content

Commit 252e78f

Browse files
committed
docs: note about user-controlled ImageMagick save targets
1 parent e7ee5b0 commit 252e78f

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

user_guide_src/source/libraries/images.rst

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,10 @@ only applies to JPEG and WebP images, will be ignored otherwise:
9191

9292
.. note:: The parameter ``$quality`` for WebP can be used since v4.4.0.
9393

94+
.. note:: When using ImageMagick, the target path passed to ``save()`` determines the output format by its extension.
95+
ImageMagick may also interpret explicit format prefixes like ``jpg:filename.png``. If the target path is based on user
96+
input, validate it against the formats your application allows, including any format prefix or extension.
97+
9498
.. literalinclude:: images/005.php
9599

96100
.. note:: Higher quality will result in larger file sizes. See also https://www.php.net/manual/en/function.imagejpeg.php
@@ -153,8 +157,7 @@ The ``convert()`` method changes the library's internal indicator for the desire
153157

154158
.. literalinclude:: images/009.php
155159

156-
.. note:: ImageMagick already saves files in the type
157-
indicated by their extension, ignoring ``$imageType``.
160+
.. note:: ImageMagick already saves files in the type indicated by their extension, ignoring ``$imageType``.
158161

159162
Fitting Images
160163
==============

0 commit comments

Comments
 (0)