<?xml version="1.0"?>
<?xml-stylesheet
href="http://www.w3.org/2000/08/w3c-synd/style.css" type="text/css"
?>
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns="http://purl.org/rss/1.0/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:sy="http://purl.org/rss/1.0/modules/syndication/" xmlns:admin="http://webns.net/mvcb/" xmlns:content="http://purl.org/rss/1.0/modules/content/">
    <channel rdf:about="http://pear.php.net/bugs/search.php">
    <title>PEAR Bug Search Results</title>
    <link>http://pear.php.net/bugs/search.php?cmd=display&amp;package_name%5B0%5D=Image_Transform</link>
    <description>Search Results</description>
    <dc:language>en-us</dc:language>
    <dc:creator>pear-webmaster@lists.php.net</dc:creator>
    <dc:publisher>pear-webmaster@lists.php.net</dc:publisher>
    <admin:generatorAgent rdf:resource="http://pear.php.net/bugs"/>
    <sy:updatePeriod>hourly</sy:updatePeriod>
    <sy:updateFrequency>1</sy:updateFrequency>
    <sy:updateBase>2000-01-01T12:00+00:00</sy:updateBase>
    <items>
     <rdf:Seq>
      <rdf:li rdf:resource="http://pear.php.net/bug/19447" />
      <rdf:li rdf:resource="http://pear.php.net/bug/19379" />
      <rdf:li rdf:resource="http://pear.php.net/bug/19329" />
      <rdf:li rdf:resource="http://pear.php.net/bug/19279" />
      <rdf:li rdf:resource="http://pear.php.net/bug/18824" />
      <rdf:li rdf:resource="http://pear.php.net/bug/18592" />
      <rdf:li rdf:resource="http://pear.php.net/bug/18393" />
      <rdf:li rdf:resource="http://pear.php.net/bug/18249" />
      <rdf:li rdf:resource="http://pear.php.net/bug/18131" />
      <rdf:li rdf:resource="http://pear.php.net/bug/16650" />
      <rdf:li rdf:resource="http://pear.php.net/bug/7412" />
      <rdf:li rdf:resource="http://pear.php.net/bug/7405" />
      <rdf:li rdf:resource="http://pear.php.net/bug/5047" />

     </rdf:Seq>
    </items>
  </channel>

  <image rdf:about="http://pear.php.net/gifs/pearsmall.gif">
    <title>PEAR Bugs</title>
    <url>http://pear.php.net/gifs/pearsmall.gif</url>
    <link>http://pear.php.net/bugs</link>
  </image>

    <item rdf:about="http://pear.php.net/bug/19447">
      <title>Image_Transform: Bug 19447 [Open] imagejpeg(): Filename cannot be empty</title>
      <link>http://pear.php.net/bugs/19447</link>
      <content:encoded><![CDATA[<pre>Image_Transform Bug
Reported by paszczak000
2012-06-01T00:20:32+00:00
PHP: 5.4.3 OS: Centos 6.2 64bit Package Version: 0.9.5

Description:
------------
I see this error, but var $filename is set.

Test script:
---------------
http://pastebin.com/4q7vDnxz

Actual result:
--------------
PHP Warning:  imagejpeg(): Filename cannot be empty in /usr/lib/php/Image/Transform/Driver/GD.php on line 473</pre>]]></content:encoded>
      <description><![CDATA[<pre>Image_Transform Bug
Reported by paszczak000
2012-06-01T00:20:32+00:00
PHP: 5.4.3 OS: Centos 6.2 64bit Package Version: 0.9.5

Description:
------------
I see this error, but var $filename is set.

Test script:
---------------
http://pastebin.com/4q7vDnxz

Actual result:
--------------
PHP Warning:  imagejpeg(): Filename cannot be empty in /usr/lib/php/Image/Transform/Driver/GD.php on line 473</pre>]]></description>
      <dc:date>2012-06-01T00:20:32+00:00</dc:date>
      <dc:creator>paszczak000 &amp;#x61;&amp;#116; gmail &amp;#x64;&amp;#111;&amp;#x74; com</dc:creator>
      <dc:subject>Image_Transform Bug</dc:subject>
    </item>
    <item rdf:about="http://pear.php.net/bug/19379">
      <title>Image_Transform: Bug 19379 [Open] Missing color index check in _createImage()</title>
      <link>http://pear.php.net/bugs/19379</link>
      <content:encoded><![CDATA[<pre>Image_Transform Bug
Reported by michael_heuberger
2012-04-10T13:56:50+00:00
PHP: 5.2.6 OS: Apache 2.2 Package Version: 0.9.5

Description:
------------
Hi there

I'm seeing this PHP error coming from class Image_Transform_Driver_GD:

Warning: imagecolorsforindex() [function.imagecolorsforindex]: Color index 255

It's thrown at line 602. And I can guess why. Some GIF images can have a transparency index higher than 255, especially when animated.

So I recommend you to obtain the palette size first with imagecolorstotal(), here a good example:
http://stackoverflow.com/questions/3874533/what-could-cause-a-color-index-out-of-range-error-for-imagecolorsforindex

Thanks for the bug fix, cheers :)
Michael H</pre>]]></content:encoded>
      <description><![CDATA[<pre>Image_Transform Bug
Reported by michael_heuberger
2012-04-10T13:56:50+00:00
PHP: 5.2.6 OS: Apache 2.2 Package Version: 0.9.5

Description:
------------
Hi there

I'm seeing this PHP error coming from class Image_Transform_Driver_GD:

Warning: imagecolorsforindex() [function.imagecolorsforindex]: Color index 255

It's thrown at line 602. And I can guess why. Some GIF images can have a transparency index higher than 255, especially when animated.

So I recommend you to obtain the palette size first with imagecolorstotal(), here a good example:
http://stackoverflow.com/questions/3874533/what-could-cause-a-color-index-out-of-range-error-for-imagecolorsforindex

Thanks for the bug fix, cheers :)
Michael H</pre>]]></description>
      <dc:date>2012-04-10T16:12:09+00:00</dc:date>
      <dc:creator>mick &amp;#x61;&amp;#116; deafzone &amp;#x64;&amp;#111;&amp;#x74; ch</dc:creator>
      <dc:subject>Image_Transform Bug</dc:subject>
    </item>
    <item rdf:about="http://pear.php.net/bug/19329">
      <title>Image_Transform: Feature/Change Request 19329 [Open] fitOnCanvas for imagick3 &amp; GD</title>
      <link>http://pear.php.net/bugs/19329</link>
      <content:encoded><![CDATA[<pre>Image_Transform Feature/Change Request
Reported by gamesh
2012-03-12T15:12:58+00:00
PHP: 5.3.6 OS: Ubuntu Package Version: 0.9.4

Description:
------------
i wrote fitOnCanvas for imagick3, feel free to add this:
/**
	 * @param integer $width
	 * @param integer $height
	 * @param string $position
	 * @param string $backgroundColor
	 * @return boolean 
	 */
	public function fitOnCanvas($width, $height, $position = 'center', $backgroundColor = 'white')
	{
		$this-&gt;fit($width, $height);
		$canvas = new Imagick();

		$canvas-&gt;newImage($width, $height, new ImagickPixel($backgroundColor), $this-&gt;imagick-&gt;getFormat());
		switch ($position) {
			case 'center':
			default:
				$x = ($width - $this-&gt;getNewImageWidth()) / 2;
				$y = ($height - $this-&gt;getNewImageHeight()) / 2;
				break;
		}
		$x = round($x);
		$y = round($y);
		
		$result = $canvas-&gt;compositeImage($this-&gt;imagick, imagick::COMPOSITE_OVER, $x, $y);
		$this-&gt;new_x = $canvas-&gt;getImageWidth();
		$this-&gt;new_y = $canvas-&gt;getImageHeight();
		$this-&gt;imagick-&gt;setimage($canvas);		
		return $result;
	}</pre>]]></content:encoded>
      <description><![CDATA[<pre>Image_Transform Feature/Change Request
Reported by gamesh
2012-03-12T15:12:58+00:00
PHP: 5.3.6 OS: Ubuntu Package Version: 0.9.4

Description:
------------
i wrote fitOnCanvas for imagick3, feel free to add this:
/**
	 * @param integer $width
	 * @param integer $height
	 * @param string $position
	 * @param string $backgroundColor
	 * @return boolean 
	 */
	public function fitOnCanvas($width, $height, $position = 'center', $backgroundColor = 'white')
	{
		$this-&gt;fit($width, $height);
		$canvas = new Imagick();

		$canvas-&gt;newImage($width, $height, new ImagickPixel($backgroundColor), $this-&gt;imagick-&gt;getFormat());
		switch ($position) {
			case 'center':
			default:
				$x = ($width - $this-&gt;getNewImageWidth()) / 2;
				$y = ($height - $this-&gt;getNewImageHeight()) / 2;
				break;
		}
		$x = round($x);
		$y = round($y);
		
		$result = $canvas-&gt;compositeImage($this-&gt;imagick, imagick::COMPOSITE_OVER, $x, $y);
		$this-&gt;new_x = $canvas-&gt;getImageWidth();
		$this-&gt;new_y = $canvas-&gt;getImageHeight();
		$this-&gt;imagick-&gt;setimage($canvas);		
		return $result;
	}</pre>]]></description>
      <dc:date>2012-04-02T12:17:14+00:00</dc:date>
      <dc:creator>justinasu &amp;#x61;&amp;#116; gmail &amp;#x64;&amp;#111;&amp;#x74; com</dc:creator>
      <dc:subject>Image_Transform Feature/Change Request</dc:subject>
    </item>
    <item rdf:about="http://pear.php.net/bug/19279">
      <title>Image_Transform: Feature/Change Request 19279 [Open] Change role for example files</title>
      <link>http://pear.php.net/bugs/19279</link>
      <content:encoded><![CDATA[<pre>Image_Transform Feature/Change Request
Reported by mfonda
2012-02-07T00:55:54+00:00
PHP: Irrelevant OS:  Package Version: 0.9.4

Description:
------------
package.xml currently lists the role for example files as &quot;php&quot;, 
but it may be better to have them listed as &quot;doc&quot; so they don't 
get installed into php_dir. &quot;doc&quot; role for example files seems to 
be the norm for most packages.</pre>]]></content:encoded>
      <description><![CDATA[<pre>Image_Transform Feature/Change Request
Reported by mfonda
2012-02-07T00:55:54+00:00
PHP: Irrelevant OS:  Package Version: 0.9.4

Description:
------------
package.xml currently lists the role for example files as &quot;php&quot;, 
but it may be better to have them listed as &quot;doc&quot; so they don't 
get installed into php_dir. &quot;doc&quot; role for example files seems to 
be the norm for most packages.</pre>]]></description>
      <dc:date>2012-02-07T00:55:54+00:00</dc:date>
      <dc:creator>mfonda &amp;#x61;&amp;#116; php &amp;#x64;&amp;#111;&amp;#x74; net</dc:creator>
      <dc:subject>Image_Transform Feature/Change Request</dc:subject>
    </item>
    <item rdf:about="http://pear.php.net/bug/18824">
      <title>Image_Transform: Bug 18824 [Open] Display + Save dont work...</title>
      <link>http://pear.php.net/bugs/18824</link>
      <content:encoded><![CDATA[<pre>Image_Transform Bug
Reported by sharmpro
2011-09-11T05:29:57+00:00
PHP: 5.3.6 OS: WIN7+XAMPP Package Version: 0.9.4

Description:
------------
...
$im-&gt;resize($max_width, $max_height);
$im-&gt;keepSettingsOnSave(true);
$im-&gt;display('jpg',$quality);
$im-&gt;save($resized,('jpg',$quality);
...

The displayed image is resized correctly, while the saved file image is a copy of the originale without any transformation.

Thank you</pre>]]></content:encoded>
      <description><![CDATA[<pre>Image_Transform Bug
Reported by sharmpro
2011-09-11T05:29:57+00:00
PHP: 5.3.6 OS: WIN7+XAMPP Package Version: 0.9.4

Description:
------------
...
$im-&gt;resize($max_width, $max_height);
$im-&gt;keepSettingsOnSave(true);
$im-&gt;display('jpg',$quality);
$im-&gt;save($resized,('jpg',$quality);
...

The displayed image is resized correctly, while the saved file image is a copy of the originale without any transformation.

Thank you</pre>]]></description>
      <dc:date>2011-09-11T05:29:57+00:00</dc:date>
      <dc:creator>stefano &amp;#x61;&amp;#116; sharmpro &amp;#x64;&amp;#111;&amp;#x74; com</dc:creator>
      <dc:subject>Image_Transform Bug</dc:subject>
    </item>
    <item rdf:about="http://pear.php.net/bug/18592">
      <title>Image_Transform: Bug 18592 [Open] Imagick3 compression quality</title>
      <link>http://pear.php.net/bugs/18592</link>
      <content:encoded><![CDATA[<pre>Image_Transform Bug
Reported by fredericpoeydomenge
2011-06-09T16:29:07+00:00
PHP: 5.3.1 OS:  Package Version: 0.9.4

Description:
------------
I found some issues related to &quot;quality&quot; parameter in Image/Transform/Driver/Imagick3.php class :

First of all, the &quot;setImageCompression&quot; method is mistakenly invoked to set Quality, when it should rather be a call to &quot;setImageCompressionQuality&quot; method...

Also, I noticed that when generating thumbnails, resulting files are much bigger than corresponding GD picture (same quality parameter) ?!? To solve that, I discovered that a call to Imagick::stripImage() would clean extraneous data...


Test script:
---------------
Replace :

$this-&gt;imagick-&gt;setImageCompression($quality);

By :

$this-&gt;imagick-&gt;setImageCompression(Imagick::COMPRESSION_JPEG);
$this-&gt;imagick-&gt;setImageCompressionQuality($quality);
$this-&gt;imagick-&gt;stripImage();</pre>]]></content:encoded>
      <description><![CDATA[<pre>Image_Transform Bug
Reported by fredericpoeydomenge
2011-06-09T16:29:07+00:00
PHP: 5.3.1 OS:  Package Version: 0.9.4

Description:
------------
I found some issues related to &quot;quality&quot; parameter in Image/Transform/Driver/Imagick3.php class :

First of all, the &quot;setImageCompression&quot; method is mistakenly invoked to set Quality, when it should rather be a call to &quot;setImageCompressionQuality&quot; method...

Also, I noticed that when generating thumbnails, resulting files are much bigger than corresponding GD picture (same quality parameter) ?!? To solve that, I discovered that a call to Imagick::stripImage() would clean extraneous data...


Test script:
---------------
Replace :

$this-&gt;imagick-&gt;setImageCompression($quality);

By :

$this-&gt;imagick-&gt;setImageCompression(Imagick::COMPRESSION_JPEG);
$this-&gt;imagick-&gt;setImageCompressionQuality($quality);
$this-&gt;imagick-&gt;stripImage();</pre>]]></description>
      <dc:date>2011-06-09T16:29:07+00:00</dc:date>
      <dc:creator>fpoeydomenge &amp;#x61;&amp;#116; free &amp;#x64;&amp;#111;&amp;#x74; fr</dc:creator>
      <dc:subject>Image_Transform Bug</dc:subject>
    </item>
    <item rdf:about="http://pear.php.net/bug/18393">
      <title>Image_Transform: Feature/Change Request 18393 [Open] load image from string data</title>
      <link>http://pear.php.net/bugs/18393</link>
      <content:encoded><![CDATA[<pre>Image_Transform Feature/Change Request
Reported by sharmpro
2011-03-24T04:30:16+00:00
PHP: 5.3.5 OS: irrilevant Package Version: 0.9.4

Description:
------------
load image from string data is missing... (imagecreatefromstring)</pre>]]></content:encoded>
      <description><![CDATA[<pre>Image_Transform Feature/Change Request
Reported by sharmpro
2011-03-24T04:30:16+00:00
PHP: 5.3.5 OS: irrilevant Package Version: 0.9.4

Description:
------------
load image from string data is missing... (imagecreatefromstring)</pre>]]></description>
      <dc:date>2011-03-24T04:30:16+00:00</dc:date>
      <dc:creator>stefano &amp;#x61;&amp;#116; sharmpro &amp;#x64;&amp;#111;&amp;#x74; com</dc:creator>
      <dc:subject>Image_Transform Feature/Change Request</dc:subject>
    </item>
    <item rdf:about="http://pear.php.net/bug/18249">
      <title>Image_Transform: Bug 18249 [Open] expects parameter 2 to be resource, null given</title>
      <link>http://pear.php.net/bugs/18249</link>
      <content:encoded><![CDATA[<pre>Image_Transform Bug
Reported by hm2k
2011-02-08T00:51:20+00:00
PHP: 5.3.4 OS: CentOS Package Version: 0.9.3

Description:
------------
When script is called on certain images, errors occur.

Error checking should be improved so that the functions in the 
package calling imagecopyresampled() and imagecopyresized() 
check for potential problems and return a (descriptive) error 
before the function is called.

Test script:
---------------
&lt;?php
  $file=tempnam('','media');
  $q='http://www.hpi.co.uk/images/test/15635_0_0.9955380731532122_ORIG.jpg';
  @copy($q,$file);
  require_once 'Image/Transform.php';
  $i =&amp; Image_Transform::factory('');
  $i-&gt;load($file);
  $i-&gt;setOption('quality','100');
  $i-&gt;setOption('scaleMethod','smooth');
  $i-&gt;fit($width,$height);
  $i-&gt;save($file,'jpeg');
?&gt;

Expected result:
----------------
[picture]

Actual result:
--------------
Warning: imagecopyresampled() expects parameter 2 to be 
resource, null given in 
/usr/share/pear/Image/Transform/Driver/GD.php on line 403
Warning: imagecopyresized() expects parameter 2 to be 
resource, null given in 
/usr/share/pear/Image/Transform/Driver/GD.php on line 406</pre>]]></content:encoded>
      <description><![CDATA[<pre>Image_Transform Bug
Reported by hm2k
2011-02-08T00:51:20+00:00
PHP: 5.3.4 OS: CentOS Package Version: 0.9.3

Description:
------------
When script is called on certain images, errors occur.

Error checking should be improved so that the functions in the 
package calling imagecopyresampled() and imagecopyresized() 
check for potential problems and return a (descriptive) error 
before the function is called.

Test script:
---------------
&lt;?php
  $file=tempnam('','media');
  $q='http://www.hpi.co.uk/images/test/15635_0_0.9955380731532122_ORIG.jpg';
  @copy($q,$file);
  require_once 'Image/Transform.php';
  $i =&amp; Image_Transform::factory('');
  $i-&gt;load($file);
  $i-&gt;setOption('quality','100');
  $i-&gt;setOption('scaleMethod','smooth');
  $i-&gt;fit($width,$height);
  $i-&gt;save($file,'jpeg');
?&gt;

Expected result:
----------------
[picture]

Actual result:
--------------
Warning: imagecopyresampled() expects parameter 2 to be 
resource, null given in 
/usr/share/pear/Image/Transform/Driver/GD.php on line 403
Warning: imagecopyresized() expects parameter 2 to be 
resource, null given in 
/usr/share/pear/Image/Transform/Driver/GD.php on line 406</pre>]]></description>
      <dc:date>2011-02-08T21:22:52+00:00</dc:date>
      <dc:creator>hm2k &amp;#x61;&amp;#116; php &amp;#x64;&amp;#111;&amp;#x74; net</dc:creator>
      <dc:subject>Image_Transform Bug</dc:subject>
    </item>
    <item rdf:about="http://pear.php.net/bug/18131">
      <title>Image_Transform: Bug 18131 [Open] Not reset $resized after save</title>
      <link>http://pear.php.net/bugs/18131</link>
      <content:encoded><![CDATA[<pre>Image_Transform Bug
Reported by regdos
2010-12-21T22:41:45+00:00
PHP: 5.3.3 OS: Linux Package Version: 0.9.3

Description:
------------
1. Resize image
2. Save image
3. Resize image
4. Save image
&quot;You have already resized the image without saving it. Your previous resizing will be overwritten&quot; and save file is not resized :(

I used GD driver and functions &quot;display&quot; and &quot;save&quot; don't have $this-&gt;resized = false;

In IMLIB driver functions &quot;display&quot; and &quot;save&quot; have $this-&gt;resized = false;

Test script:
---------------
$i = &amp;Image_Transform::factory('GD');
$i-&gt;keepSettingsOnSave(true);
$i-&gt;load($_o_file);
$i-&gt;scaleByX($start_x);
$i-&gt;save($_n_file, 'jpg', 90);
$i-&gt;scaleByX($PAGE['conf']['ksiazka']['width_m']);
$i-&gt;save($_m_file, 'jpg', 90);
$i-&gt;scaleByX($PAGE['conf']['ksiazka']['width_t']);
$i-&gt;save($_t_file, 'jpg', 90);
$i-&gt;free();</pre>]]></content:encoded>
      <description><![CDATA[<pre>Image_Transform Bug
Reported by regdos
2010-12-21T22:41:45+00:00
PHP: 5.3.3 OS: Linux Package Version: 0.9.3

Description:
------------
1. Resize image
2. Save image
3. Resize image
4. Save image
&quot;You have already resized the image without saving it. Your previous resizing will be overwritten&quot; and save file is not resized :(

I used GD driver and functions &quot;display&quot; and &quot;save&quot; don't have $this-&gt;resized = false;

In IMLIB driver functions &quot;display&quot; and &quot;save&quot; have $this-&gt;resized = false;

Test script:
---------------
$i = &amp;Image_Transform::factory('GD');
$i-&gt;keepSettingsOnSave(true);
$i-&gt;load($_o_file);
$i-&gt;scaleByX($start_x);
$i-&gt;save($_n_file, 'jpg', 90);
$i-&gt;scaleByX($PAGE['conf']['ksiazka']['width_m']);
$i-&gt;save($_m_file, 'jpg', 90);
$i-&gt;scaleByX($PAGE['conf']['ksiazka']['width_t']);
$i-&gt;save($_t_file, 'jpg', 90);
$i-&gt;free();</pre>]]></description>
      <dc:date>2010-12-21T22:41:45+00:00</dc:date>
      <dc:creator>tomek &amp;#x61;&amp;#116; regdos &amp;#x64;&amp;#111;&amp;#x74; com</dc:creator>
      <dc:subject>Image_Transform Bug</dc:subject>
    </item>
    <item rdf:about="http://pear.php.net/bug/16650">
      <title>Image_Transform: Bug 16650 [Open] Resource handle is lost on save/display</title>
      <link>http://pear.php.net/bugs/16650</link>
      <content:encoded><![CDATA[<pre>Image_Transform Bug
Reported by mirko
2009-09-28T04:29:46+00:00
PHP: 5.2.5 OS:  Package Version: 0.9.3

Description:
------------
 GD.php:486   $this-&gt;imageHandle = $this-&gt;oldImage;

 it probably has to be the opposite
 $this-&gt;oldImage =  $this-&gt;imageHandle;

else the resource handle is lost unless you've called manipulation functions before and they have set  $this-&gt;oldImage</pre>]]></content:encoded>
      <description><![CDATA[<pre>Image_Transform Bug
Reported by mirko
2009-09-28T04:29:46+00:00
PHP: 5.2.5 OS:  Package Version: 0.9.3

Description:
------------
 GD.php:486   $this-&gt;imageHandle = $this-&gt;oldImage;

 it probably has to be the opposite
 $this-&gt;oldImage =  $this-&gt;imageHandle;

else the resource handle is lost unless you've called manipulation functions before and they have set  $this-&gt;oldImage</pre>]]></description>
      <dc:date>2009-09-28T04:29:46+00:00</dc:date>
      <dc:creator>mirko &amp;#x61;&amp;#116; stranicata &amp;#x64;&amp;#111;&amp;#x74; com</dc:creator>
      <dc:subject>Image_Transform Bug</dc:subject>
    </item>
    <item rdf:about="http://pear.php.net/bug/7412">
      <title>Image_Transform: Feature/Change Request 7412 [Verified] Need function which returns image content</title>
      <link>http://pear.php.net/bugs/7412</link>
      <content:encoded><![CDATA[<pre>Image_Transform Feature/Change Request
Reported by kroseneg@...
2006-04-17T16:18:32+00:00
PHP: Irrelevant OS:  Package Version: 0.9.0

Description:
------------
I need a function which returns the image as string for inserting it into a database.
Although it would be possible to save the file and then use get_file_contents(), it would be much nicer to directly get the image as a result from a function, e.g. $content = $image-&gt;getFile();</pre>]]></content:encoded>
      <description><![CDATA[<pre>Image_Transform Feature/Change Request
Reported by kroseneg@...
2006-04-17T16:18:32+00:00
PHP: Irrelevant OS:  Package Version: 0.9.0

Description:
------------
I need a function which returns the image as string for inserting it into a database.
Although it would be possible to save the file and then use get_file_contents(), it would be much nicer to directly get the image as a result from a function, e.g. $content = $image-&gt;getFile();</pre>]]></description>
      <dc:date>2008-04-28T12:13:05+00:00</dc:date>
      <dc:creator>kroseneg &amp;#x61;&amp;#116; schmidham &amp;#x64;&amp;#111;&amp;#x74; net</dc:creator>
      <dc:subject>Image_Transform Feature/Change Request</dc:subject>
    </item>
    <item rdf:about="http://pear.php.net/bug/7405">
      <title>Image_Transform: Feature/Change Request 7405 [Open] Enhanced fit() function</title>
      <link>http://pear.php.net/bugs/7405</link>
      <content:encoded><![CDATA[<pre>Image_Transform Feature/Change Request
Reported by chri1709
2006-04-15T20:24:56+00:00
PHP: Irrelevant OS:  Package Version: 0.9.0

Description:
------------
Enhaned version of fit()...
two additional parameters are required:

$exactly (bool) - determines wether the image must have the 
exactly (!) the size as specified by the $width and $height 
parameters

$keepasprect (bool) - determines whether the aspect ratio of 
the orginal image is mainted or not

Test script:
---------------
My version of the fit() function:

    function fit($width, $height, $exactly=false, $keepaspect=true)
    {
        if ($width &lt;= 0 || $height &lt;= 0) {
            return PEAR::raiseError(&quot;Invalid arguments.&quot;,
                IMAGE_TRANSFORM_ERROR_ARGUMENT);
        }

        $x = $this-&gt;img_x / $width;
        $y = $this-&gt;img_y / $height;
 		
		if ($exactly == false) {
			if ($x &lt;= 1 &amp;&amp; $y &lt;= 1) {
	            return true;
			} elseif ($x &gt; $y) {
	            return $this-&gt;scaleByX($width);
	        } else {
	            return $this-&gt;scaleByY($height);
	        }
		} else {
			if ($keepaspect == false) {
				return $this-&gt;resize($width, $height);
			} elseif ($x == $y) {
					return $this-&gt;scaleByX($width);
			} elseif ($x &gt; $y) {
				$res = $this-&gt;scaleByX($width);
				if (PEAR::isError($res)) {
					return $res;
				} else {
					return $this-&gt;crop($width, $height, 0, round(($this-&gt;img_y-$height)/2, 0));
				}
			} elseif ($x &lt; $y) {
				$res = $this-&gt;scaleByY($height);
				if (PEAR::isError($res)) {
					return $res;
				} else {
					return $this-&gt;crop($width, $height, round(($this-&gt;img_x-$width)/2, 0), 0);
				}
			}
		}
    }

Expected result:
----------------
With the additial parameter, this function is perfect for 
creating thumbnails for example!

There may be bugs in my version of fit()</pre>]]></content:encoded>
      <description><![CDATA[<pre>Image_Transform Feature/Change Request
Reported by chri1709
2006-04-15T20:24:56+00:00
PHP: Irrelevant OS:  Package Version: 0.9.0

Description:
------------
Enhaned version of fit()...
two additional parameters are required:

$exactly (bool) - determines wether the image must have the 
exactly (!) the size as specified by the $width and $height 
parameters

$keepasprect (bool) - determines whether the aspect ratio of 
the orginal image is mainted or not

Test script:
---------------
My version of the fit() function:

    function fit($width, $height, $exactly=false, $keepaspect=true)
    {
        if ($width &lt;= 0 || $height &lt;= 0) {
            return PEAR::raiseError(&quot;Invalid arguments.&quot;,
                IMAGE_TRANSFORM_ERROR_ARGUMENT);
        }

        $x = $this-&gt;img_x / $width;
        $y = $this-&gt;img_y / $height;
 		
		if ($exactly == false) {
			if ($x &lt;= 1 &amp;&amp; $y &lt;= 1) {
	            return true;
			} elseif ($x &gt; $y) {
	            return $this-&gt;scaleByX($width);
	        } else {
	            return $this-&gt;scaleByY($height);
	        }
		} else {
			if ($keepaspect == false) {
				return $this-&gt;resize($width, $height);
			} elseif ($x == $y) {
					return $this-&gt;scaleByX($width);
			} elseif ($x &gt; $y) {
				$res = $this-&gt;scaleByX($width);
				if (PEAR::isError($res)) {
					return $res;
				} else {
					return $this-&gt;crop($width, $height, 0, round(($this-&gt;img_y-$height)/2, 0));
				}
			} elseif ($x &lt; $y) {
				$res = $this-&gt;scaleByY($height);
				if (PEAR::isError($res)) {
					return $res;
				} else {
					return $this-&gt;crop($width, $height, round(($this-&gt;img_x-$width)/2, 0), 0);
				}
			}
		}
    }

Expected result:
----------------
With the additial parameter, this function is perfect for 
creating thumbnails for example!

There may be bugs in my version of fit()</pre>]]></description>
      <dc:date>2006-04-16T21:31:27+00:00</dc:date>
      <dc:creator>c &amp;#x64;&amp;#111;&amp;#x74; schiessl &amp;#x61;&amp;#116; gmx &amp;#x64;&amp;#111;&amp;#x74; net</dc:creator>
      <dc:subject>Image_Transform Feature/Change Request</dc:subject>
    </item>
    <item rdf:about="http://pear.php.net/bug/5047">
      <title>Image_Transform: Feature/Change Request 5047 [Open] GD driver addition: applyBorderImage() function</title>
      <link>http://pear.php.net/bugs/5047</link>
      <content:encoded><![CDATA[<pre>Image_Transform Feature/Change Request
Reported by norbert
2005-08-09T23:12:56+00:00
PHP: Irrelevant OS: Irrelevant Package Version: 

Description:
------------
class Image_Transform_Driver_GD extends Image_Transform
{

    /**
     * Apply a border image around the image
     *
     * @param int $borderhandle Handle of the loaded border image
     * @param int $padding_left Left margin of the current image on the border
     * @param int $padding_right Top margin of the current image on the border
     * @author Norbert Mocsnik
     * @return bool TRUE
     * @access public
     */
    function applyBorderImage($borderhandle, $padding_left, $padding_right)
    {
        $this-&gt;new_x = imagesx($borderhandle);
        $this-&gt;new_y = imagesy($borderhandle);
        
        $new_img = $this-&gt;_createImage($this-&gt;new_x, $this-&gt;new_y, $this-&gt;true_color);

        ImageCopy($new_img, $borderhandle, 0, 0, 0, 0, $this-&gt;new_x, $this-&gt;new_y);
        ImageCopy($new_img, $this-&gt;imageHandle, $padding_left, $padding_right, 0, 0, $this-&gt;img_x, $this-&gt;img_y);
        
        $this-&gt;imageHandle = $new_img;
        $this-&gt;resized = true;

        return true;
    }

Test script:
---------------
I wanted to suggest to insert this into the manual but we currently don't have documentation for Image_Transform. I don't know the correct PHPDoc syntax to paste this as an example:

$borderimage = Image_Transform::factory('GD');
$borderimage-&gt;load('mygraphicborder.jpg');

$imgtr = Image_Transform::factory('GD');
$imgtr-&gt;load('tmp/uploaded_image.jpg');
$imgtr-&gt;applyBorderImage($borderimage-&gt;imageHandle, 7, 7);
$imgtr-&gt;save('uploads/image_with_border.jpg', '', 90);</pre>]]></content:encoded>
      <description><![CDATA[<pre>Image_Transform Feature/Change Request
Reported by norbert
2005-08-09T23:12:56+00:00
PHP: Irrelevant OS: Irrelevant Package Version: 

Description:
------------
class Image_Transform_Driver_GD extends Image_Transform
{

    /**
     * Apply a border image around the image
     *
     * @param int $borderhandle Handle of the loaded border image
     * @param int $padding_left Left margin of the current image on the border
     * @param int $padding_right Top margin of the current image on the border
     * @author Norbert Mocsnik
     * @return bool TRUE
     * @access public
     */
    function applyBorderImage($borderhandle, $padding_left, $padding_right)
    {
        $this-&gt;new_x = imagesx($borderhandle);
        $this-&gt;new_y = imagesy($borderhandle);
        
        $new_img = $this-&gt;_createImage($this-&gt;new_x, $this-&gt;new_y, $this-&gt;true_color);

        ImageCopy($new_img, $borderhandle, 0, 0, 0, 0, $this-&gt;new_x, $this-&gt;new_y);
        ImageCopy($new_img, $this-&gt;imageHandle, $padding_left, $padding_right, 0, 0, $this-&gt;img_x, $this-&gt;img_y);
        
        $this-&gt;imageHandle = $new_img;
        $this-&gt;resized = true;

        return true;
    }

Test script:
---------------
I wanted to suggest to insert this into the manual but we currently don't have documentation for Image_Transform. I don't know the correct PHPDoc syntax to paste this as an example:

$borderimage = Image_Transform::factory('GD');
$borderimage-&gt;load('mygraphicborder.jpg');

$imgtr = Image_Transform::factory('GD');
$imgtr-&gt;load('tmp/uploaded_image.jpg');
$imgtr-&gt;applyBorderImage($borderimage-&gt;imageHandle, 7, 7);
$imgtr-&gt;save('uploads/image_with_border.jpg', '', 90);</pre>]]></description>
      <dc:date>2005-08-10T14:09:05+00:00</dc:date>
      <dc:creator>norbert &amp;#x61;&amp;#116; mocsnik &amp;#x64;&amp;#111;&amp;#x74; hu</dc:creator>
      <dc:subject>Image_Transform Feature/Change Request</dc:subject>
    </item>
</rdf:RDF>
