reference/image/functions/imagescale.xml
593ea510e853ff034e03f78a4be0daa41661c9d4
...
...
@@ -1,6 +1,5 @@
1
1
<?xml version="1.0" encoding="utf-8"?>
2
2
<!-- $Revision$ -->
3
-

4
3
<refentry xml:id="function.imagescale" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
5
4
<refnamediv>
6
5
<refname>imagescale</refname>
...
...
@@ -10,16 +9,23 @@
10
9
<refsect1 role="description">
11
10
&reftitle.description;
12
11
<methodsynopsis>
13
-
<type>resource</type><methodname>imagescale</methodname>
14
-
<methodparam><type>resource</type><parameter>image</parameter></methodparam>
15
-
<methodparam><type>int</type><parameter>new_width</parameter></methodparam>
16
-
<methodparam choice="opt"><type>int</type><parameter>new_height</parameter><initializer>-1</initializer></methodparam>
17
-
<methodparam choice="opt"><type>int</type><parameter>mode</parameter><initializer>IMG_BILINEAR_FIXED</initializer></methodparam>
12
+
<type class="union"><type>GdImage</type><type>false</type></type><methodname>imagescale</methodname>
13
+
<methodparam><type>GdImage</type><parameter>image</parameter></methodparam>
14
+
<methodparam><type>int</type><parameter>width</parameter></methodparam>
15
+
<methodparam choice="opt"><type>int</type><parameter>height</parameter><initializer>-1</initializer></methodparam>
16
+
<methodparam choice="opt"><type>int</type><parameter>mode</parameter><initializer><constant>IMG_BILINEAR_FIXED</constant></initializer></methodparam>
18
17
</methodsynopsis>
19
18
<para>
20
19
<function>imagescale</function> scales an image using the given
21
20
interpolation algorithm.
22
21
</para>
22
+
<note>
23
+
<para>
24
+
Unlike many of other image functions, <function>imagescale</function> does
25
+
not modify the passed <parameter>image</parameter>; instead, a
26
+
<emphasis>new</emphasis> image is returned.
27
+
</para>
28
+
</note>
23
29
</refsect1>
24
30

25
31
<refsect1 role="parameters">
...
...
@@ -27,7 +33,7 @@
27
33
<variablelist>
28
34
&gd.image.description;
29
35
<varlistentry>
30
-
<term><parameter>new_width</parameter></term>
36
+
<term><parameter>width</parameter></term>
31
37
<listitem>
32
38
<para>
33
39
The width to scale the image to.
...
...
@@ -35,18 +41,12 @@
35
41
</listitem>
36
42
</varlistentry>
37
43
<varlistentry>
38
-
<term><parameter>new_height</parameter></term>
44
+
<term><parameter>height</parameter></term>
39
45
<listitem>
40
46
<para>
41
47
The height to scale the image to. If omitted or negative, the aspect
42
48
ratio will be preserved.
43
49
</para>
44
-
<caution>
45
-
<para>
46
-
You should always provide the height if using PHP 5.5.18 or earlier, or
47
-
PHP 5.6.2 or earlier, as the aspect ratio calculation was incorrect.
48
-
</para>
49
-
</caution>
50
50
</listitem>
51
51
</varlistentry>
52
52
<varlistentry>
...
...
@@ -58,6 +58,11 @@
58
58
<constant>IMG_BICUBIC</constant>,
59
59
<constant>IMG_BICUBIC_FIXED</constant> or anything else (will use two
60
60
pass).
61
+
<note>
62
+
<simpara>
63
+
<constant>IMG_WEIGHTED4</constant> is not yet supported.
64
+
</simpara>
65
+
</note>
61
66
</para>
62
67
</listitem>
63
68
</varlistentry>
...
...
@@ -67,37 +72,43 @@
67
72
<refsect1 role="returnvalues">
68
73
&reftitle.returnvalues;
69
74
<para>
70
-
Return the scaled image resource on success&return.falseforfailure;.
75
+
Return the scaled image object on success&return.falseforfailure;.
71
76
</para>
72
77
</refsect1>
73
78

74
79
<refsect1 role="changelog">
75
80
&reftitle.changelog;
76
-
<para>
77
-
<informaltable>
78
-
<tgroup cols="2">
79
-
<thead>
80
-
<row>
81
-
<entry>&Version;</entry>
82
-
<entry>&Description;</entry>
83
-
</row>
84
-
</thead>
85
-
<tbody>
86
-
<row>
87
-
<entry>5.5.19/5.6.3</entry>
88
-
<entry>
89
-
The calculation of the height if <parameter>new_height</parameter> was
90
-
negative or omitted was fixed; prior to these versions, the aspect
91
-
ratio was not maintained correctly.
92
-
</entry>
93
-
</row>
94
-
</tbody>
95
-
</tgroup>
96
-
</informaltable>
97
-
</para>
81
+
<informaltable>
82
+
<tgroup cols="2">
83
+
<thead>
84
+
<row>
85
+
<entry>&Version;</entry>
86
+
<entry>&Description;</entry>
87
+
</row>
88
+
</thead>
89
+
<tbody>
90
+
<row>
91
+
<entry>8.0.0</entry>
92
+
<entry>
93
+
On success, this function returns a <classname>GDImage</classname> instance now;
94
+
previously, a <type>resource</type> was returned.
95
+
</entry>
96
+
</row>
97
+
&gd.changelog.image-param;
98
+
</tbody>
99
+
</tgroup>
100
+
</informaltable>
98
101
</refsect1>
99
-
</refentry>
100
102

103
+
<refsect1 role="seealso">
104
+
&reftitle.seealso;
105
+
<simplelist>
106
+
<member><function>imagecopyresized</function></member>
107
+
<member><function>imagecopyresampled</function></member>
108
+
</simplelist>
109
+
</refsect1>
110
+

111
+
</refentry>
101
112
<!-- Keep this comment at the end of the file
102
113
Local variables:
103
114
mode: sgml
104
115