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

 ID:                 63920
 Updated by:         paj...@php.net
 Reported by:        zebroid at list dot ru
 Summary:            imagejpeg
-Status:             Feedback
+Status:             Not a bug
 Type:               Bug
 Package:            GD related
 Operating System:   debian 6.0
 PHP Version:        5.4.10
 Block user comment: N
 Private report:     N

 New Comment:

We can't change that. It is part of the parameter parsing API. Simply use NULL 
which is actually what should have been used.


Previous Comments:
------------------------------------------------------------------------
[2013-01-08 06:42:33] zebroid at list dot ru

paj...@php.net, can you read my first post at 2013-01-06 17:04 UTC?

------------------------------------------------------------------------
[2013-01-07 18:09:33] paj...@php.net

the "" is the problem I suppose, use NULL if you don't want to save it but 
output 
it directly.

------------------------------------------------------------------------
[2013-01-07 17:09:05] zebroid at list dot ru

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);

?>

------------------------------------------------------------------------
[2013-01-07 06:16:32] paj...@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

Reply via email to