php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #58192 getFilename returns an empty string
Submitted: 2008-05-10 21:03 UTC Modified: 2008-05-10 21:10 UTC
From: me at benlake dot org Assigned:
Status: Not a bug Package: imagick (PECL)
PHP Version: 5.2.6 OS: Mac OSX Leopard
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: me at benlake dot org
New email:
PHP Version: OS:

 

 [2008-05-10 21:03 UTC] me at benlake dot org
Description:
------------
I am running PHP 5.2.6 BTW, it wasn't listed.

imagick
imagick module => enabled
imagick module version => 2.1.1
imagick classes => Imagick, ImagickDraw, ImagickPixel, 
ImagickPixelIterator
imagick.locale_fix => 0 => 0

Used getFilename as illustrated below and didn't get what I 
was expecting, which is the name of the file represented by 
the current wand.

If I am using this incorrectly then I suppose the only means 
of knowing which file is being worked on would be to 
instantiate an Imagick object for each file and not use the 
convenient batching method supported by the constructor and 
employed in the examples on php.net.




Reproduce code:
---------------
$magick = new Imagick(glob(PATH.'*.{jpg,JPG}', GLOB_BRACE));
foreach ($magick as $img)
{
    print $img->getFilename()."\n";
    $img->thumbnailImage(150,0);
    $img->writeImage();
}

Expected result:
----------------
<filename>
<filename>
<filename>

Actual result:
--------------
<empty string>
<empty string>
<empty string>




Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2008-05-10 21:07 UTC] me at benlake dot org
Updating OS and PHP version
 [2008-05-10 21:10 UTC] me at benlake dot org
getImageFilename ... apologies
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Apr 25 05:01:33 2024 UTC