From:             bug_php at yahoo dot fr
Operating system: Linux RedHat 2.4.28
PHP version:      4.3.11
PHP Bug Type:     *Graphics related
Bug description:  1 pixel missing on imagecopyresized and imagecopyresampled

Description:
------------
See PHP info on http://720plan.ovh.net/test.php (PHP version is 4.3.11 as
of 2005/07/23).

Bug  similar to the problem exposed in closed bug report #26254.

The code below results in an image that is 1 pixel too small: there is a
blank range of pixels. According to the destination image width and
height, this range of pixels can be vertical, horizontal, or both. The
code below is for a 640*480 image destination. But the same happens for a
40*40 image for instance. This problem occurs with any image and number of
pixels I tried. The only case it works: when the image destination has the
same size thant the source image.

Reproduce code:
---------------
<html>
<body bgcolor="green">
<?
$image_source_filename="bar.jpg"; //image 230*173px
$image_cible_filename="bar.gif";
$ImgSrc = imagecreatefromjpeg ($image_source_filename);
imagetruecolortopalette($ImgSrc, false, 256);
$ImgDst = imagecreate(640,480);
imagecolorallocate($ImgDst, 255, 255, 255);
imagecopyresized($ImgDst,$ImgSrc,0,0,0,0,640,480,230,173);
imagegif ($ImgDst,$image_cible_filename);
echo("<br><br><font color=\"white\">Resized image=</font><br><img
src=\"$image_cible_filename\"><br>");
?>
</body>
</html>


-- 
Edit bug report at http://bugs.php.net/?id=33836&edit=1
-- 
Try a CVS snapshot (php4):   http://bugs.php.net/fix.php?id=33836&r=trysnapshot4
Try a CVS snapshot (php5.0): 
http://bugs.php.net/fix.php?id=33836&r=trysnapshot50
Try a CVS snapshot (php5.1): 
http://bugs.php.net/fix.php?id=33836&r=trysnapshot51
Fixed in CVS:                http://bugs.php.net/fix.php?id=33836&r=fixedcvs
Fixed in release:            http://bugs.php.net/fix.php?id=33836&r=alreadyfixed
Need backtrace:              http://bugs.php.net/fix.php?id=33836&r=needtrace
Need Reproduce Script:       http://bugs.php.net/fix.php?id=33836&r=needscript
Try newer version:           http://bugs.php.net/fix.php?id=33836&r=oldversion
Not developer issue:         http://bugs.php.net/fix.php?id=33836&r=support
Expected behavior:           http://bugs.php.net/fix.php?id=33836&r=notwrong
Not enough info:             
http://bugs.php.net/fix.php?id=33836&r=notenoughinfo
Submitted twice:             
http://bugs.php.net/fix.php?id=33836&r=submittedtwice
register_globals:            http://bugs.php.net/fix.php?id=33836&r=globals
PHP 3 support discontinued:  http://bugs.php.net/fix.php?id=33836&r=php3
Daylight Savings:            http://bugs.php.net/fix.php?id=33836&r=dst
IIS Stability:               http://bugs.php.net/fix.php?id=33836&r=isapi
Install GNU Sed:             http://bugs.php.net/fix.php?id=33836&r=gnused
Floating point limitations:  http://bugs.php.net/fix.php?id=33836&r=float
No Zend Extensions:          http://bugs.php.net/fix.php?id=33836&r=nozend
MySQL Configuration Error:   http://bugs.php.net/fix.php?id=33836&r=mysqlcfg

Reply via email to