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

Request #1406 A truck load of corrections/improvements
Submitted: 2004-05-14 04:30 UTC
From: jausions Assigned:
Status: Closed Package: Image_Transform
PHP Version: Irrelevant OS: WinXP
Roadmaps: (Not assigned)    
Subscription  
Comments Add Comment Add patch


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 : 4 - 2 = ?

 
 [2004-05-14 04:30 UTC] jausions
Description: ------------ Just some corrections/improvements to the package. http://www.11abacus.com/cvs/pear/Image_Transform.diff -Philippe

Comments

 [2004-05-14 21:11 UTC] jausions
Some more updates... plus new files Same .diff as before, plus http://www.11abacus.com/cvs/pear/Image_Transform.zip Still alpha stage. -Philippe
 [2004-05-15 13:23 UTC] reywob
Hi Philippe, Many thanks for all your additions. I'm (supposed to be) revising hard for my exams so I've only had a very quick look at your diff file. As there's a lot of changes made, could you summarise what work you've done and, most importantly, the rationale behind changes to the existing code? For example, why did you extract the mime typing and image types to separate files (as opposed to what we had before)? Many thanks, Peter
 [2004-05-15 23:17 UTC] jausions
General: - Added PHP < 4,3.0 BC for image_type_to_mime_type() function - Added PHP support for IMAGETYPE_* constants - Added a way to check what image types a driver supports - member _supported_image_types - method supportsType() - Implemented for Imagick2, IM and GD (although this is alpha code...) - Added some image processing methods: - flip() - mirror() - greyscale() - Changed crop() parameter orders. Since this API is not frozen yet, it's not a real BC break... crop(width, height, x, y); instead of crop(height, width, x, y) Width are almost always refered to first so it makes more sense to switch to that order. - Added "best-guess" feature for factory() method when no driver is specified. Checks for Imagick and GD extensions... - Fixed a potential security breach in the factory method to avoid directory transversals. - Added sanity check on inclusion of driver class. - Added a method to convert string image types (i.e. GIF, PNG...) into IMAGETYPE_* constants. This is to be able to use PHP's image_type_to_mime_type. - Corrected some phpDoc on "@return null", should be "void" instead. (However, there are still some discrepancies that would need to be fixed.) - Added getMimeType() method - Corrected some typos and more explicit error messages IMHO. - Corrected some phpDoc on @return when PEAR Error object could be returned - Completed some phpDoc when information was missing - Improved color Hex <-> array conversion - Fixed getTempDir for \\ - Added place holder method for canvasResize() (as opposed to crop()) - Added PHP5 style __construct() constructors for some drivers. - Fixed some PEAR Errors that were left unchecked and/or not forwarded. - Added some error checks on library calls (i.e. imagick_convert() and so on...) - Added some checks to avoid useless operations such as no gamma changes, 360 rotation... - Adjusted code to be more compliant with PEAR's coding standards (curly braces, spaces and so on...) Below are changes specific to drivers. Driver/GD.php - Added PHP extension check for GD - Added image type support check for GD for load(), save() and display() - Use of the getMimeType() method to be more generic instead of guess a MIME type of "image/*", which is not always the case (i.e. WBMP) - Fixed free() method (resource not freed in the proper order.) - Implemented some image processing methods: - greyscale() Driver/Imagick2.php - Implemented some image processing methods: - gamma() - crop() - flip() - mirror() - Fixed display() - Attempts to use the "quality" factor - Fixed free() method to use imagick_destroy() - New file: Driver\Imagick\ImaeTypes.php containing the list of supported image types (Note: this is not nessecary accurate since Imagick rely on external libraries that may or may not be installed on the system...) Driver/IM.php - Implemented some image processing methods: - flip() - mirror() - greyscale() - Added security checks from parameters passed to the shell - Added (int) and (float) conversions for numbers - Added escapeshellarg() for strings
 [2004-05-18 22:08 UTC] jausions
Another load of fixes, improvements and implementations. The .diff and .zip files have been updated to reflect that. - Fixed constructors. Constructors cannot return values. I fixed the factory() method to check if the drivers initialized properly. Funny thing, it fixes bug # 489 which I was not aware before that. - Bug 841 should also be fixed (I noticed the problem when I used the package.) - Drivers using shell commands now check for programs presence and return PEAR error much sooner. - getImageSize() now mimic PHP\'s getimagesize() - Added support for general options: setOption() and setOptions(). Options can be set once and be used in all methods whenever appropriate. - Added support for some drivers for pixel-based resizing. And added a \"smooth\" pass whenever needed (in some drivers.) - Improved even more PEAR coding standard compliance (spaces, curly braces and so on...) - Fixed some more @return phpDoc and return statement to be consistent throughout the package and drivers. - Added a scaleByXY() method, alias for resize() - Fixed a bunch of phpDoc comments for clarification and completion. - Optimized rotate() methods to discard n*360 rotations. - Improved NetPBM::rotate() (according to pnmrotate\'s man page) - Implemented __construct() for all drivers. - Implemented supports for more image formats in NetPBM - Fixed colorarray2colorhex to handle values under 16. - Aliased grayscale() for greyscale(). - Fixed NetPBM::_postProcess() to use proper initial image format (was using target format instead.) Could you please apply all these improvements/fixes to CVS, so if someone else want to help they would have more to bite in ;-) ? -Philippe
 [2004-05-19 15:34 UTC] jausions
Ok, one more, and I'll stop there for now... all this would need testing... Fixes for Imlib driver: - Returning PEAR error when appropriate (instead of FALSE) - Fixed other returned values. - Implemented mirror() and flip() methods Enjoy ;-) -Philippe
 [2004-07-12 10:28 UTC] reywob
Patches applied to CVS