Closed (fixed)
Project:
ImageMagick
Version:
7.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
25 Oct 2009 at 01:14 UTC
Updated:
13 Feb 2011 at 22:40 UTC
Jump to comment: Most recent file
Comments
Comment #1
joachim commentedThanks for the patch :)
I don't have a system I can test imagemagick stuff on, so it's going to have to wait for someone who can test this.
Looks reasonable to a quick read, but a couple of points:
- is there a reason for your renaming _image_imagemagick_check_path() to remove the underscore? By convention the initial underscore that means it's a module-internal function. Renaming it in this patch only adds noise as far as I can tell.
- I'd appreciate a comment above this line: if (strcmp(dirname($path), ".") == 0) to say what you are testing. PHP file and string functions hurt my brain :(
Comment #2
StephaneC commentedThanks for your prompt comments.
Here are my answers:
- I remove the underscore because i need to call it from the
image_im_advanced_requirements. From my understanding i do not have other solution to make it callable from an external routine. Let me know if i am wrong.- OK, comments added, new patch provided.
Comment #3
joachim commentedI don't see a call to image_imagemagick_check_path() either with or without underscore in image_im_advanced_requirements() or anywhere in the file image_im_advanced.install.
Private functions in PHP are a convention, not a rule of the language. And to be honest, I don't know if 'private' means in the same module, or whether we can say within the image package counts as private. Logically I suppose we should mean just within the module, so your change removing the underscore is correct -- if I could find an external call to it!
Comment #4
StephaneC commentedIt is called through the following code in image_im_advanced.install:
image_toolkit_invoke("check_path", array($convert_path))Comment #5
joachim commentedOk...
so you're changing what used to be an internal function to something that's sort of hook-like in that an invoke function will treat is as an implementation....
This sounds like a big change to me, but I've no idea what this really means as I've never used imagemagick.
So if a couple of people confirm this is good, I'll commit :)
Comment #6
sunWe are about to roll a new release, so if this patch will be slightly revised ASAP, then it's going to have a good chance to be included.
Apparently, many instances of "ImageMagic" that should be "ImageMagick" in here ;)
The function name and therefore API change doesn't seem to be required - can you revert that, please?
Why don't we simply compare
?
At least, I don't understand the strcmp().
Furthermore, it looks like the second/inner condition could be added to the first.
Looks like this elseif could be written on one line.
Always use single quotes (') unless double quotes are technically required.
Powered by Dreditor.
Comment #7
lance.gliser commentedSubscribing
Comment #8
sunMoving to ImageMagick project.
Comment #9
sunNot completely happy with this yet, but it works.
Comment #10
sunThanks for reporting, reviewing, and testing! Committed attached patch to HEAD.
A new development snapshot will be available within the next 12 hours. This improvement will be available in the next official release.