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
 [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

Pull Requests

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 Dec 26 19:01:30 2024 UTC