php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #23792 8 bit graphics don't rotate properly
Submitted: 2003-05-24 10:45 UTC Modified: 2003-08-01 05:20 UTC
Votes:7
Avg. Score:5.0 ± 0.0
Reproduced:7 of 7 (100.0%)
Same Version:4 (57.1%)
Same OS:6 (85.7%)
From: phpman at priya dot 2y dot net Assigned: pajoye (profile)
Status: Closed Package: GD related
PHP Version: 4.3.2RC4 OS: Linux 2.4
Private report: No CVE-ID: None
 [2003-05-24 10:45 UTC] phpman at priya dot 2y dot net
I've tested this with both png's and gifs....

You can rotate at 90 degree angles but not at 45's or any other for that matter

For the image I'm using, the script I'm using, and an example of it in action, please visit this url

http://shancel.2y.net/wicons/wind2.php

I used this command line to configure the build
./configure --with-mysql --with-apxs --prefix=/usr --with-gd --enable-gd-native-ttf --with-gettex/usr/include --with-jpeg-dir=/usr/lib --with-png-dir=/usr/lib  --with-freetype-dir=/usr/lib

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2003-05-24 13:13 UTC] phpman at priya dot 2y dot net
while I'm at it imagecolortransparent isn't working on png24 and png32...

rotate seems to be quite broken full stop

http://shancel.2y.net/wicons/test.php is an example of rotate playing up (with a transparency work around in use)

http://shancel.2y.net/wicons/test2.php is an example of rotate playing up, just to show it's not the transparency work around causing it...
 [2003-06-20 09:09 UTC] phpman at priya dot 2y dot net
Ok, news:


as of 4.3.3RC1 the 24 bit graphics rotate better, (no more black blobs) but they still get a line on them as seen at

http://shancel.2y.net/wicons/test.php

But the 8 bit graphics do not rotate properly at all still, they get scrambled...

I can almost use it... keep up the good work
 [2003-07-09 05:20 UTC] pajoye@php.net
This bug has been fixed in CVS.

In case this was a PHP problem, snapshots of the sources are packaged
every three hours; this change will be in the next snapshot. You can
grab the snapshot at http://snaps.php.net/.
 
In case this was a documentation problem, the fix will show up soon at
http://www.php.net/manual/.

In case this was a PHP.net website problem, the change will show
up on the PHP.net site and on the mirror sites in short time.
 
Thank you for the report, and for helping us make PHP better.

imagerotate returns now truecolor images.
 [2003-07-09 19:30 UTC] phpman at priya dot 2y dot net
I've tried to build from the CVS, and I get after using the make command...

/root/php-src/ext/mysql/libmysql/my_tempnam.c:115: the use of `tempnam' is dangerous, better use `mkstemp'
ext/standard/filestat.lo: In function `php_stat':
/root/php-src/ext/standard/filestat.c:575: undefined reference to `php_check_open_basedir_ex'
collect2: ld returned 1 exit status
make: *** [sapi/cli/php] Error 1


can you help me fix this?
 [2003-07-09 21:21 UTC] phpman at priya dot 2y dot net
I still wouldn't call this completely solved.

I've managed to download and install the Jul 09, 2003 23:30 GMT snapshot.

There is still the issue with the rotate function adding lines to the rotated image...

AND below is a link to an 8 bit image rotate function that works to a point... Again the code is simply:

    $pic = imagecreatefrompng("pointer8bit.png");
    $backcolor = imagecolorat($pic,1,1);
    $pic = imagerotate($pic,$_GET['r'],$backcolor);
    header('Content-type: image/png');
    imagepng($pic);

http://shancel.2y.net/wicons/wind2.php?r=45 - Works (1-45 works fine)
http://shancel.2y.net/wicons/wind2.php?r=46 - Completely Black
http://shancel.2y.net/wicons/wind2.php?r=90 - Completely Black
http://shancel.2y.net/wicons/wind2.php?r=180 - Completely Black

http://shancel.2y.net/wicons/wind2.php?r=316 - Works (316-360 works fine)


Here is a link to my php info: http://shancel.2y.net/php.php
 [2003-07-09 21:30 UTC] phpman at priya dot 2y dot net
Also, to further this, generated by the following code

$base = imagecreatefrompng('windspeed.png');
$pic24bit = imagecreatefrompng("pointer.png");
$pic24bit = imagerotate($pic24bit,$rot[$_GET['r']],imagecolorat($pic24bit,1,1));
imagecopy($base,$pic24bit,(imagesx($base)-imagesx($pic24bit))/2,(imagesy($base)-imagesy($pic24bit))/2,1,1,imagesx($pic24bit),imagesy($pic24bit));
header('Content-type: image/jpeg');
imagejpeg($base);

I get lines in the image that arn't there in the original.
please see screenshot http://shancel.2y.net/wicons/phperrors.jpg where I've highlighted these errors with a blue line parallel to them.
 [2003-07-09 21:49 UTC] sniper@php.net
Pierre..fix it properly. :)

 [2003-07-30 12:34 UTC] iliaa@php.net
This bug has been fixed in CVS.

In case this was a PHP problem, snapshots of the sources are packaged
every three hours; this change will be in the next snapshot. You can
grab the snapshot at http://snaps.php.net/.
 
In case this was a documentation problem, the fix will show up soon at
http://www.php.net/manual/.

In case this was a PHP.net website problem, the change will show
up on the PHP.net site and on the mirror sites in short time.
 
Thank you for the report, and for helping us make PHP better.


 [2003-08-01 05:20 UTC] phpman at priya dot 2y dot net
YES IT'S FIXED!

Thank you thank you thank you!
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Dec 26 10:01:29 2024 UTC