Bug #63920 [Com]: imagejpeg
| From: | zebroid at list dot ru | Date: | Mon, 07 Jan 2013 17:09:05 +0000 |
| Subject: | Bug #63920 [Com]: imagejpeg | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-175820@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=63920&edit=1
ID: 63920
Comment by: zebroid at list dot ru
Reported by: zebroid at list dot ru
Summary: imagejpeg
Status: Feedback
Type: Bug
Package: GD related
Operating System: debian 6.0
PHP Version: 5.4.10
Block user comment: N
Private report: N
New Comment:
hm... well, it something like this
<?php
$jpeg_filename = "http://php.net/manual/en/images/21009b70229598c6a80eef8b45bf282b-imagecreatefromjpeg.jpg";
//or link to any local jpeg file
$jpeg_quality = 90;
$img = imagecreatefromjpeg($jpeg_filename);
header('Content-Type: image/jpeg');
//next line dont work in php 5.4, but work in php 5.3
imagejpeg($img, '', $jpeg_quality);
?>
Previous Comments:
------------------------------------------------------------------------
[2013-01-07 06:16:32] pajoye@php.net
Thank you for this bug report. To properly diagnose the problem, we
need a short but complete example script to be able to reproduce
this bug ourselves.
A proper reproducing script starts with <?php and ends with ?>,
is max. 10-20 lines long and does not require any external
resources such as databases, etc. If the script requires a
database to demonstrate the issue, please make sure it creates
all necessary tables, stored procedures etc.
Please avoid embedding huge scripts into the report.
------------------------------------------------------------------------
[2013-01-06 17:04:03] zebroid at list dot ru
Description:
------------
after update php 5.3->php 5.4 i have a problem with image thumbnails in vbulletin forum v 3.8.7
(last in the 3.x branch)
after some investigations i find the problem. code
imagejpeg($image, '', $quality);
works fine in php 5.3 and output jpeg image to browser
but in php 5.4 in only generate error:
Warning: imagejpeg(): Filename cannot be empty in [path]/includes/class_image.php on line 1428
i read a documentation http://php.net/manual/en/function.imagejpeg.php
and understand that now it should works maybe in more 'pedantic' way (imagejpeg($image,
NULL, $quality)), but maybe for the Backward Compatible you make this function work in a old way?
(NULL or '' in secord parameter to output jpeg)
or, at least, mention about that on http://php.net/manual/en/migration54.incompatible.php
vBulletin v3.x still rather popular and suppose that not only i may face this problem
(and sorry for my russian-english)
Test script:
---------------
imagejpeg($image, '', $quality); <-work in php 5.3, dont work in php 5.4
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=63920&edit=1