Bug #71316 [Asn->Csd]: libpng warning from imagecreatefromstring

From: Date: Thu, 04 Nov 2021 10:22:58 +0000
Subject: Bug #71316 [Asn->Csd]: libpng warning from imagecreatefromstring
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-237545@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=71316&edit=1

 ID:                 71316
 Updated by:         git@php.net
 Reported by:        humbads at alum dot mit dot edu
 Summary:            libpng warning from imagecreatefromstring
-Status:             Assigned
+Status:             Closed
 Type:               Bug
 Package:            GD related
 Operating System:   FreeBSD 10.2
 PHP Version:        5.6.17
 Assigned To:        cmb
 Block user comment: N
 Private report:     N

 New Comment:

Automatic comment on behalf of cmb69
Revision: https://github.com/php/php-src/commit/1919c4b44ddd9f056bd53c79c4b99c9e4ce97884
Log: Fix #71316: libpng warning from imagecreatefromstring


Previous Comments:
------------------------------------------------------------------------
[2021-10-26 12:59:39] cmb@php.net

The following pull request has been associated:

Patch Name: Fix #71316: libpng warning from imagecreatefromstring
On GitHub:  https://github.com/php/php-src/pull/7615
Patch:      https://github.com/php/php-src/pull/7615.patch

------------------------------------------------------------------------
[2021-10-21 16:40:22] cmb@php.net

The upstream issue has been fixed[1]; we have to backport that to
our bundled libgd.

[1] <https://github.com/libgd/libgd/commit/636100b9280a86e70d852d89251fc5492fce33f4>

------------------------------------------------------------------------
[2021-09-02 06:14:54] 2598059791 at qq dot com

$imgInfo = getimagesize($imageFile);
        $img_w = $imgInfo[0];
        $img_h = $imgInfo[1];

        switch ($imgInfo[2]){
            case 1:
                $bgImg =imagecreatefromgif($imageFile);  //gif
                break;
            case 2:
                $bgImg =imagecreatefromjpeg($imageFile); //jpg
                break;
            case 3:
                $bgImg = imagecreatefrompng($imageFile);  //png
                break;
            default:
                die("不支持的图片文件类型");
                exit;
        }
        $fontfile = ROOT_DIR.'/../../Resources/font/simhei.ttf';
        $fontfile = ROOT_DIR.'/font/simhei.ttf';
        if(file_exists($fontfile)){
            echo $imageFile."\n\n";
        }
        $text_color = imagecolorallocatealpha($bgImg,0,0,0,75);
        $pos_x = 30;
        $pos_y = $img_h - 20;
        imagettftext($bgImg, 12, 0, $pos_x, $pos_y, $text_color, $fontfile,
'审核药师:');
        $shenhe_img = imagecreatefrompng( ROOT_DIR.'/yaoshi/'.$shenhe );
        $shenheImgInfo = getimagesize( ROOT_DIR.'/yaoshi/'.$shenhe );
        $resize_h = 35;
        $resize_w = intval($shenheImgInfo[0]*$resize_h/$shenheImgInfo[1]);
        $pos_x = 110;
        $pos_y = $img_h-$resize_h-5;
        imagecopyresized($bgImg, $shenhe_img, $pos_x, $pos_y, 0, 0, $resize_w, $resize_h,
$shenheImgInfo[0], $shenheImgInfo[1]);

------------------------------------------------------------------------
[2021-07-23 09:19:23] cmb@php.net

> amazing for how many years random shit don't get fixed and no i
> don't care who and where is resposnible

Thanks for your valuable open-source contribution.

------------------------------------------------------------------------
[2020-11-04 19:50:14] rtrtrtrtrt at dfdfdfdf dot dfd

amazing for how many years random shit don't get fixed and no i don't care who and where
is resposnible

------------------------------------------------------------------------


The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at

    https://bugs.php.net/bug.php?id=71316


--
Edit this bug report at https://bugs.php.net/bug.php?id=71316&edit=1


Thread (16 messages)

« previous php.bugs (#237545) next »