Bug #62632 [Opn]: Incorrect image generated

From: Date: Sun, 22 Jul 2012 20:52:10 +0000
Subject: Bug #62632 [Opn]: Incorrect image generated
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-172154@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=62632&edit=1

 ID:                 62632
 User updated by:    marc at phpmyadmin dot net
 Reported by:        marc at phpmyadmin dot net
 Summary:            Incorrect image generated
 Status:             Open
 Type:               Bug
 Package:            GD related
 Operating System:   Linux
 PHP Version:        5.4.5
 Block user comment: N
 Private report:     N

 New Comment:

Here is the image I used:
http://www.infomarc.info/MarcDelisle-140x185.jpg


Previous Comments:
------------------------------------------------------------------------
[2012-07-22 19:18:32] ab@php.net

$contents = file_get_contents('marc.jpg');

A link to marc.jpg would be useful.

------------------------------------------------------------------------
[2012-07-22 15:17:53] marc at phpmyadmin dot net

Description:
------------
The test script (master.html calling image.php) works fine with PHP 5.3.13 but fails to produce an
image with PHP 5.4.4 or 5.4.5.

'./configure' '--with-apxs2=/usr/local/apache2/bin/apxs'
'--with-libdir=lib64' '--disable-debug' '--enable-calendar'
'--with-gd=shared' '--with-freetype-dir' '--with-mysql=shared,mysqlnd'
'--with-mysqli=shared,mysqlnd' '--with-regex=php'
'--with-png-dir=/usr/lib' '--with-zlib=shared' '--with-iconv=shared'
'--enable-ftp' '--with-mcrypt=shared' '--with-bz2=shared'
'--enable-zip' '--with-jpeg-dir=/usr/lib' '--enable-mbstring'
'--without-sqlite' '--enable-dom' '--enable-json'
'--with-pdo-mysql=mysqlnd' '--with-pear' '--enable-bcmath'
'--with-curl=shared' '--with-ldap=shared,/usr' '--with-gettext=shared'
'--with-snmp=shared' '--enable-soap' '--enable-sockets' 

Test script:
---------------
master.html:
<html>
<head></head>
<body>
<img border="0" alt="the photo should be here" src="image.php"
/>
</body>
</html>

image.php:
<?php
$contents = file_get_contents('marc.jpg');
header('Content-Type: image/JPEG');
header('Content-Transfer-Encoding: binary');

$srcImage = imagecreatefromstring($contents);
ImageJPEG($srcImage, '', 75);
?>


Expected result:
----------------
A photo is displayed.

Actual result:
--------------
The alt tag of the photo is displayed.


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



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


Thread (7 messages)

« previous php.bugs (#172154) next »