php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #65297 Gmagick::writeimage requires a filename whereas documentation says it's optiona
Submitted: 2013-07-19 17:14 UTC Modified: 2018-06-18 13:06 UTC
Votes:2
Avg. Score:5.0 ± 0.0
Reproduced:1 of 2 (50.0%)
Same Version:1 (100.0%)
Same OS:1 (100.0%)
From: imprec at gmail dot com Assigned:
Status: Verified Package: gmagick (PECL)
PHP Version: Irrelevant OS: irrelevant
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please — but make sure to vote on the bug!
Your email address:
MUST BE VALID
Solve the problem:
42 + 34 = ?
Subscribe to this entry?

 
 [2013-07-19 17:14 UTC] imprec at gmail dot com
Description:
------------
Gmagick::writeimage documentation 
(http://php.net/manual/en/gmagick.writeimage.php) says filename is optional. It 
should work without a filename if Gmagick::setimagefilename has been called.

it actually throws an exception if the filename is set to null. Calling the method 
withtout argument triggers a warning (Gmagick::writeimage() expects at least 1 
parameter, 0 given)

Imagick provides the same thing, see 
http://fr2.php.net/manual/en/imagick.writeimage.php

Test script:
---------------
$gmagick = new Gmagick('duck.jpg');
$gmagick->writeimage();

or 

$gmagick = new Gmagick('duck.jpg');
$gmagick->writeimage(null);


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2018-06-18 13:06 UTC] cmb@php.net
-Status: Open +Status: Verified
 [2018-06-18 13:06 UTC] cmb@php.net
That's obviously a bug, since there is code to hande the case
where filename == NULL, but zpp() expects s(tring) without !
modifier.
 [2023-02-05 09:49 UTC] kiamlaluno at isepro dot org
Even the following code throws an exception.

$image = new Gmagick();
$image->readImage("2301_04215826.png");
$image->writeImage();
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Apr 19 22:01:28 2024 UTC