cvs: phpdoc /en/reference/image/functions imagecopyresampled.xml

From: Date: Sat, 05 Aug 2006 16:06:29 +0000
Subject: cvs: phpdoc /en/reference/image/functions imagecopyresampled.xml
Groups: php.doc 
Request: Send a blank email to phpdoc+get-969373668@lists.php.net to get a copy of this message
colder Sat Aug 5 16:06:29 2006 UTC Modified files: /phpdoc/en/reference/image/functions imagecopyresampled.xml Log: Fix resize example http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/image/functions/imagecopyresampled.xml?r1=1.6&r2=1.7&diff_format=u Index: phpdoc/en/reference/image/functions/imagecopyresampled.xml diff -u phpdoc/en/reference/image/functions/imagecopyresampled.xml:1.6 phpdoc/en/reference/image/functions/imagecopyresampled.xml:1.7 --- phpdoc/en/reference/image/functions/imagecopyresampled.xml:1.6 Mon Oct 4 09:50:18 2004 +++ phpdoc/en/reference/image/functions/imagecopyresampled.xml Sat Aug 5 16:06:29 2006 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.6 $ --> +<!-- $Revision: 1.7 $ --> <!-- splitted from ./en/functions/image.xml, last change in rev 1.36 --> <refentry id="function.imagecopyresampled"> <refnamediv> @@ -115,10 +115,12 @@ // Get new dimensions list($width_orig, $height_orig) = getimagesize($filename); -if ($width && ($width_orig < $height_orig)) { - $width = ($height / $height_orig) * $width_orig; +$ratio_orig = $width_orig/$height_orig; + +if ($width/$height > $ratio_orig) { + $width = $height*$ratio_orig; } else { - $height = ($width / $width_orig) * $height_orig; + $height = $width/$ratio_orig; } // Resample

« previous php.doc (#969373668) next »