From 24b94ee6529196aa45a98fa68c39e853d717ca36 Mon Sep 17 00:00:00 2001 From: kenjis Date: Sat, 30 Mar 2024 21:07:15 +0900 Subject: [PATCH 1/6] docs: add empty line --- user_guide_src/source/libraries/images.rst | 1 + 1 file changed, 1 insertion(+) diff --git a/user_guide_src/source/libraries/images.rst b/user_guide_src/source/libraries/images.rst index 0507c5d36529..409e40707ec8 100644 --- a/user_guide_src/source/libraries/images.rst +++ b/user_guide_src/source/libraries/images.rst @@ -49,6 +49,7 @@ Regardless of the type of processing you would like to perform (resizing, cropping, rotation, or watermarking), the general process is identical. You will set some preferences corresponding to the action you intend to perform, then call one of the available processing functions. + For example, to create an image thumbnail you'll do this: .. literalinclude:: images/003.php From c691ecb4d3cc2b565ac7c42292aa6a008e9f1cdb Mon Sep 17 00:00:00 2001 From: kenjis Date: Sat, 30 Mar 2024 21:07:36 +0900 Subject: [PATCH 2/6] docs: update description --- user_guide_src/source/libraries/images.rst | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/user_guide_src/source/libraries/images.rst b/user_guide_src/source/libraries/images.rst index 409e40707ec8..4afdd2acd049 100644 --- a/user_guide_src/source/libraries/images.rst +++ b/user_guide_src/source/libraries/images.rst @@ -55,9 +55,9 @@ For example, to create an image thumbnail you'll do this: .. literalinclude:: images/003.php The above code tells the library to look for an image -called *mypic.jpg* located in the source_image folder, then create a -new image from it that is 100 x 100pixels using the GD2 image_library, -and save it to a new file (the thumb). Since it is using the ``fit()`` method, +called **mypic.jpg** located in the **/path/to/image** folder, then create a +new image from it that is 100 x 100 pixels, +and save it to a new file **mypic_thumb.jpg**. Since it is using the ``fit()`` method, it will attempt to find the best portion of the image to crop based on the desired aspect ratio, and then crop and resize the result. From fad2cde0f30e8bd319b135bdda08d35bca2fd737 Mon Sep 17 00:00:00 2001 From: kenjis Date: Sat, 30 Mar 2024 21:08:25 +0900 Subject: [PATCH 3/6] docs: add spaces --- user_guide_src/source/libraries/images.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/user_guide_src/source/libraries/images.rst b/user_guide_src/source/libraries/images.rst index 4afdd2acd049..0bbb167ecc9b 100644 --- a/user_guide_src/source/libraries/images.rst +++ b/user_guide_src/source/libraries/images.rst @@ -69,7 +69,7 @@ previous results: .. literalinclude:: images/004.php This example would take the same image and first fix any mobile phone orientation issues, -rotate the image by 90 degrees, and then crop the result into a 100x100 pixel image, +rotate the image by 90 degrees, and then crop the result into a 100 x 100 pixel image, starting at the top left corner. The result would be saved as the thumbnail. .. note:: In order for the image class to be allowed to do any @@ -136,7 +136,7 @@ thumbnail images that should match a certain size/aspect ratio. This is handled - ``$maintainRatio`` will, if true, adjust the final dimensions as needed to maintain the image's original aspect ratio. - ``$masterDim`` specifies which dimension should be left untouched when ``$maintainRatio`` is true. Values can be: ``'width'``, ``'height'``, or ``'auto'``. -To take a 50x50 pixel square out of the center of an image, you would need to first calculate the appropriate x and y +To take a 50 x 50 pixel square out of the center of an image, you would need to first calculate the appropriate x and y offset values: .. literalinclude:: images/008.php From b2a1a8acf78dde2c9c6341300585254b1f911abe Mon Sep 17 00:00:00 2001 From: kenjis Date: Sat, 30 Mar 2024 21:10:03 +0900 Subject: [PATCH 4/6] docs: decorate argument values --- user_guide_src/source/libraries/images.rst | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/user_guide_src/source/libraries/images.rst b/user_guide_src/source/libraries/images.rst index 0bbb167ecc9b..e4bbfd816467 100644 --- a/user_guide_src/source/libraries/images.rst +++ b/user_guide_src/source/libraries/images.rst @@ -252,17 +252,17 @@ that allow you to specify how the text should be displayed: The possible options that are recognized are as follows: -- ``color`` Text Color (hex number), i.e., #ff0000 -- ``opacity`` A number between 0 and 1 that represents the opacity of the text. +- ``color`` Text Color (hex number), i.e., ``'#ff0000'`` +- ``opacity`` A number between ``0`` and ``1`` that represents the opacity of the text. - ``withShadow`` Boolean value whether to display a shadow or not. - ``shadowColor`` Color of the shadow (hex number) - ``shadowOffset`` How many pixels to offset the shadow. Applies to both the vertical and horizontal values. -- ``hAlign`` Horizontal alignment: left, center, right -- ``vAlign`` Vertical alignment: top, middle, bottom +- ``hAlign`` Horizontal alignment: ``'left'``, ``'center'``, ``'right'`` +- ``vAlign`` Vertical alignment: ``'top'``, ``'middle'``, ``'bottom'`` - ``hOffset`` Additional offset on the x axis, in pixels - ``vOffset`` Additional offset on the y axis, in pixels - ``fontPath`` The full server path to the TTF font you wish to use. System font will be used if none is given. -- ``fontSize`` The font size to use. When using the GD handler with the system font, valid values are between 1-5. +- ``fontSize`` The font size to use. When using the GD handler with the system font, valid values are between ``1`` to ``5``. .. note:: The ImageMagick driver does not recognize full server path for fontPath. Instead, simply provide the name of one of the installed system fonts that you wish to use, i.e., Calibri. From be473e2924fbba0761ec8583732a352eb49de69b Mon Sep 17 00:00:00 2001 From: kenjis Date: Sat, 30 Mar 2024 21:10:34 +0900 Subject: [PATCH 5/6] docs: add missing `\` --- user_guide_src/source/libraries/images.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/user_guide_src/source/libraries/images.rst b/user_guide_src/source/libraries/images.rst index e4bbfd816467..30537832cadd 100644 --- a/user_guide_src/source/libraries/images.rst +++ b/user_guide_src/source/libraries/images.rst @@ -232,7 +232,7 @@ The ``rotate()`` method allows you to rotate an image in 90 degree increments:: - ``$angle`` is the number of degrees to rotate. One of ``90``, ``180``, ``270``. .. note:: While the ``$angle`` parameter accepts a float, it will convert it to an integer during the process. - If the value is any other than the three values listed above, it will throw a CodeIgniter\Images\ImageException. + If the value is any other than the three values listed above, it will throw a ``CodeIgniter\Images\ImageException``. Adding a Text Watermark ======================= From c729ffd3ae28a1fdfcf34dbc7fe4e94ffa96fce9 Mon Sep 17 00:00:00 2001 From: kenjis Date: Sat, 30 Mar 2024 21:11:23 +0900 Subject: [PATCH 6/6] docs: replace WEBP with WebP --- user_guide_src/source/libraries/images.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/user_guide_src/source/libraries/images.rst b/user_guide_src/source/libraries/images.rst index 30537832cadd..08efccfe92f9 100644 --- a/user_guide_src/source/libraries/images.rst +++ b/user_guide_src/source/libraries/images.rst @@ -86,7 +86,7 @@ Image Quality ``save()`` can take an additional parameter ``$quality`` to alter the resulting image quality. Values range from 0 to 100 with 90 being the framework default. This parameter -only applies to JPEG and WEBP images, will be ignored otherwise: +only applies to JPEG and WebP images, will be ignored otherwise: .. note:: The parameter ``$quality`` for WebP can be used since v4.4.0.