Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 11 additions & 2 deletions reference/exif/functions/exif-read-data.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision$ -->
<!-- splitted from ./en/functions/image.xml, last change in rev 1.78 -->
<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xml:id="function.exif-read-data">
<refentry xml:id="function.exif-read-data" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
<refnamediv>
<refname>exif_read_data</refname>
<refpurpose>Reads the <acronym>EXIF</acronym> headers from an image file</refpurpose>
Expand Down Expand Up @@ -186,6 +185,16 @@
</row>
</thead>
<tbody>
<row>
<entry>8.5.0</entry>
<entry>
The <literal>OffsetTime</literal>, <literal>OffsetTimeOriginal</literal>
and <literal>OffsetTimeDigitized</literal> tags are now recognized;
previously they were reported as <literal>UndefinedTag:0x9010</literal>,
<literal>UndefinedTag:0x9011</literal> and
<literal>UndefinedTag:0x9012</literal>.
</entry>
</row>
<row>
<entry>8.0.0</entry>
<entry>
Expand Down
13 changes: 13 additions & 0 deletions reference/image/constants.xml
Original file line number Diff line number Diff line change
Expand Up @@ -713,6 +713,19 @@
</simpara>
</listitem>
</varlistentry>
<varlistentry xml:id="constant.imagetype-svg">
<term>
<constant>IMAGETYPE_SVG</constant>
(<type>int</type>)
</term>
<listitem>
&gd.constants.type;
<simpara>
(Available as of PHP 8.5.0, only if the
<link linkend="book.libxml">libxml</link> extension is loaded)
</simpara>
</listitem>
</varlistentry>
<varlistentry xml:id="constant.imagetype-unknown">
<term>
<constant>IMAGETYPE_UNKNOWN</constant>
Expand Down
119 changes: 76 additions & 43 deletions reference/image/functions/getimagesize.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision$ -->
<refentry xmlns:xlink="http://www.w3.org/1999/xlink" xmlns="http://docbook.org/ns/docbook" xml:id="function.getimagesize">
<refentry xml:id="function.getimagesize" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns="http://docbook.org/ns/docbook">
<refnamediv>
<refname>getimagesize</refname>
<refpurpose>Get the size of an image</refpurpose>
Expand Down Expand Up @@ -45,6 +45,15 @@
codestream it encounters in the root of the file.
</simpara>
</note>
<note>
<simpara>
SVG images are only recognized if the <link linkend="book.libxml">libxml</link>
extension is loaded. The root <tag>svg</tag> element must have
<literal>width</literal> and <literal>height</literal> attributes, each an
integer optionally followed by a unit, such as <literal>5cm</literal>.
Otherwise, &false; is returned.
</simpara>
</note>
<note>
<simpara>
The information about icons are retrieved from the icon with the highest
Expand Down Expand Up @@ -102,10 +111,10 @@

<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
Returns an array with up to 7 elements. Not all image types will include
<simpara>
Returns an array with up to 9 elements. Not all image types will include
the <literal>channels</literal> and <literal>bits</literal> elements.
</para>
</simpara>
<para>
Index 0 and 1 contains respectively the width and the height of the image.
</para>
Expand All @@ -129,11 +138,12 @@
Index 2 is one of the <constant>IMAGETYPE_<replaceable>*</replaceable></constant> constants indicating
the type of the image.
</para>
<para>
<simpara>
Index 3 is a text string with the correct
<literal>height="yyy" width="xxx"</literal> string that can be used
directly in an <acronym>IMG</acronym> tag.
</para>
directly in an <acronym>IMG</acronym> tag. It is omitted if the width or
the height is not expressed in pixels.
</simpara>
<para>
<literal>mime</literal> is the corresponding MIME type of the image.
This information can be used to deliver images with the correct HTTP
Expand All @@ -157,6 +167,12 @@ if ($size && $fp) {
</programlisting>
</example>
</para>
<simpara>
<literal>width_unit</literal> and <literal>height_unit</literal> are the
units in which index 0 and 1 are expressed. They are <literal>"px"</literal>
unless the image states otherwise, as SVG images can, and they may differ
from each other.
</simpara>
<para>
<literal>channels</literal> will be 3 for RGB pictures and 4 for CMYK
pictures.
Expand Down Expand Up @@ -193,42 +209,59 @@ if ($size && $fp) {

<refsect1 role="changelog">
&reftitle.changelog;
<para>
<informaltable>
<tgroup cols="2">
<thead>
<row>
<entry>&Version;</entry>
<entry>&Description;</entry>
</row>
</thead>
<tbody>
<row>
<entry>8.2.0</entry>
<entry>
Now returns the actual image dimensions, bits and channels of AVIF images;
previously, the dimensions were reported as <literal>0x0</literal>,
and bits and channels were not reported at all.
</entry>
</row>
<row>
<entry>8.0.0</entry>
<entry>
A <exceptionname>ValueError</exceptionname> is now thrown if
<parameter>filename</parameter> is empty; previously an
<constant>E_WARNING</constant> was raised and the function returned &false;.
</entry>
</row>
<row>
<entry>7.1.0</entry>
<entry>
Added WebP support.
</entry>
</row>
</tbody>
</tgroup>
</informaltable>
</para>
<informaltable>
<tgroup cols="2">
<thead>
<row>
<entry>&Version;</entry>
<entry>&Description;</entry>
</row>
</thead>
<tbody>
<row>
<entry>8.5.0</entry>
<entry>
Added support for HEIF/HEIC images.
</entry>
</row>
<row>
<entry>8.5.0</entry>
<entry>
Added support for SVG images, if the libxml extension is loaded.
</entry>
</row>
<row>
<entry>8.5.0</entry>
<entry>
The returned array now contains the <literal>width_unit</literal> and
<literal>height_unit</literal> elements.
</entry>
</row>
<row>
<entry>8.2.0</entry>
<entry>
Now returns the actual image dimensions, bits and channels of AVIF images;
previously, the dimensions were reported as <literal>0x0</literal>,
and bits and channels were not reported at all.
</entry>
</row>
<row>
<entry>8.0.0</entry>
<entry>
A <exceptionname>ValueError</exceptionname> is now thrown if
<parameter>filename</parameter> is empty; previously an
<constant>E_WARNING</constant> was raised and the function returned &false;.
</entry>
</row>
<row>
<entry>7.1.0</entry>
<entry>
Added WebP support.
</entry>
</row>
</tbody>
</tgroup>
</informaltable>
</refsect1>

<refsect1 role="examples">
Expand Down
24 changes: 24 additions & 0 deletions reference/image/functions/image-type-to-extension.xml
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,30 @@
</para>
</refsect1>

<refsect1 role="changelog">
&reftitle.changelog;
<informaltable>
<tgroup cols="2">
<thead>
<row>
<entry>&Version;</entry>
<entry>&Description;</entry>
</row>
</thead>
<tbody>
<row>
<entry>8.5.0</entry>
<entry>
Added support for <constant>IMAGETYPE_HEIF</constant> (<literal>.heif</literal>)
and, if the <link linkend="book.libxml">libxml</link> extension is
loaded, <constant>IMAGETYPE_SVG</constant> (<literal>.svg</literal>).
</entry>
</row>
</tbody>
</tgroup>
</informaltable>
</refsect1>

<refsect1 role="examples">
&reftitle.examples;
<para>
Expand Down
7 changes: 7 additions & 0 deletions reference/image/functions/image-type-to-mime-type.xml
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,13 @@
<entry><constant>IMAGETYPE_HEIF</constant></entry>
<entry><literal>image/heif</literal></entry>
</row>
<row>
<entry>
<constant>IMAGETYPE_SVG</constant> (only if the
<link linkend="book.libxml">libxml</link> extension is loaded)
</entry>
<entry><literal>image/svg+xml</literal></entry>
</row>
</tbody>
</tgroup>
</table>
Expand Down
Loading