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
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 !
Your email address:
MUST BE VALID
Solve the problem:
31 + 31 = ?
Subscribe to this entry?

 
 [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: Fri Apr 19 22:01:28 2024 UTC