Package home | Report new bug | New search | Development Roadmap Status: Open | Feedback | All | Closed Since Version 1.0.0RC1

Bug #8840 Undefined local variable resultImage
Submitted: 2006-10-03 14:00 UTC
From: rumata at php dot net Assigned: firman
Status: Closed Package: Image_Tools (version 0.3.0)
PHP Version: Irrelevant OS: irrelevant
Roadmaps: (Not assigned)    
Subscription  


 [2006-10-03 14:00 UTC] rumata at php dot net (Ildar Shaimordanov)
Description: ------------ Illegal usage of the local variable $resultImage in 'Image_Tools::display' and 'Image_Tools::save' methods at Image/Tools.php When using Image::Tools package with any mistakes (for example: passing filename of non-existent image) Actual lines are 657: return PEAR::raiseError('Error rendering: ' . $resultImage->getMessage()); 705: return PEAR::raiseError('Error rendering: ' . $resultImage->getMessage()); IMHO, they must be 657: return PEAR::raiseError('Error rendering: ' . $res->getMessage()); 705: return PEAR::raiseError('Error rendering: ' . $res->getMessage()); Test script: --------------- <?php // Modified example from the package require_once 'Image/Tools.php'; $options = array('image' => 'non-existent-path/pear.png'); $tool =& Image_Tools::factory('swap', $options); if (PEAR::isError($tool)) { die($tool->toString()); } $err = $tool->display(); if (PEAR::isError($err)) { die($err->toString()); } ?> Expected result: ---------------- [pear_error: message="Error rendering: Failed to create image from string data" code=0 mode=return level=notice prefix="" info=""] Actual result: -------------- Warning: imagecreatefromstring() [function.imagecreatefromstring]: Data is not in a recognized format. in z:\home\localhost\www\Image\Tools.php on line 542 Notice: Undefined variable: resultImage in z:\home\localhost\www\Image\Tools.php on line 657 Fatal error: Call to a member function getMessage() on a z:\home\localhost\www\Image\Tools.php on line 657

Comments

 [2006-10-03 14:21 UTC] User who submitted this comment has not confirmed identity
If you submitted this note, check your email.If you do not have a message, click here to re-send
MANUAL CONFIRMATION IS NOT POSSIBLE.  Write a message to pear-dev@lists.php.net
to request the confirmation link.  All bugs/comments/patches associated with this

email address will be deleted within 48 hours if the account request is not confirmed!