<?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/16650" />
      <rdf:li rdf:resource="http://pear.php.net/bug/16070" />
      <rdf:li rdf:resource="http://pear.php.net/bug/16069" />
      <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/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-27T23: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-27T23: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-27T23: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/16070">
      <title>Image_Transform: Feature/Change Request 16070 [Open] Select Imagick2 but id dosen't work on PHP5</title>
      <link>http://pear.php.net/bugs/16070</link>
      <content:encoded><![CDATA[<pre>Image_Transform Feature/Change Request
Reported by fkrauthan
2009-04-04T20:01:56+00:00
PHP: 5.2.9 OS: Linux Package Version: CVS

Description:
------------
If you use PHP5 an you would select the Imagick Driver Image_Transform use imagick2 automaticly. But on PHP5 it dosen't work so you must use Imagick3 on PHP 5</pre>]]></content:encoded>
      <description><![CDATA[<pre>Image_Transform Feature/Change Request
Reported by fkrauthan
2009-04-04T20:01:56+00:00
PHP: 5.2.9 OS: Linux Package Version: CVS

Description:
------------
If you use PHP5 an you would select the Imagick Driver Image_Transform use imagick2 automaticly. But on PHP5 it dosen't work so you must use Imagick3 on PHP 5</pre>]]></description>
      <dc:date>2009-04-11T19:38:36+00:00</dc:date>
      <dc:creator>fkrauthan &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/16069">
      <title>Image_Transform: Feature/Change Request 16069 [Open] Gif Transparent Bug</title>
      <link>http://pear.php.net/bugs/16069</link>
      <content:encoded><![CDATA[<pre>Image_Transform Feature/Change Request
Reported by fkrauthan
2009-04-04T19:57:46+00:00
PHP: 5.2.9 OS: Linux Package Version: CVS

Description:
------------
If you Save a Image or Display a Image that has the Type GIF and has Transparent the transparent would get black.</pre>]]></content:encoded>
      <description><![CDATA[<pre>Image_Transform Feature/Change Request
Reported by fkrauthan
2009-04-04T19:57:46+00:00
PHP: 5.2.9 OS: Linux Package Version: CVS

Description:
------------
If you Save a Image or Display a Image that has the Type GIF and has Transparent the transparent would get black.</pre>]]></description>
      <dc:date>2009-04-04T19:57:46+00:00</dc:date>
      <dc:creator>fkrauthan &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/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-17T11: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-17T11: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-28T07: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-15T15: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-15T15: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-16T16: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-09T18: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-09T18: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-10T09: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>
