Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added blank image creation functionality to Image constructor #53

Merged
merged 2 commits into from Sep 7, 2012

Conversation

@wronglink
Copy link
Contributor

@wronglink wronglink commented Sep 6, 2012

Sometimes it can be useful not to open image (from file or create it from blob) but to create a new blank image. An ImageMagick supports a MagickNewImage method.
I've added new parameters for blank image creation to wand.image.Image constructor.
Now, if no opening arguments (image, blob, file or filename) given it will create a new blank image specified by width, height and optional background parameters.
Tests included.

Added ability of blank image creation.
New parameters `width`, `height`, `background` are added to `wand.image.Image`
contructor.
Added tests for new functionality.
@dahlia
Copy link
Collaborator

@dahlia dahlia commented Sep 6, 2012

It’s great, why I hadn’t come up with this feature? Anyway, width, height and background parameters shouldn’t be passed if any of opening arguments (image, blob, file or filename) is passed, right?

@@ -350,10 +362,19 @@ class Image(Resource):
__slots__ = '_wand',

def __init__(self, image=None, blob=None, file=None, filename=None,
format=None):
format=None, width=None, height=None, background=None):
args = image, blob, file, filename

This comment has been minimized.

@dahlia

dahlia Sep 6, 2012
Collaborator

Now, args seems to have to be renamed to open_args.

@wronglink
Copy link
Contributor Author

@wronglink wronglink commented Sep 7, 2012

Anyway, width, height and background parameters shouldn’t be passed if any of opening arguments (image, blob, file or filename) is passed, right?

Yup. Added some additional checks on this behaviour.

dahlia added a commit that referenced this pull request Sep 7, 2012
Added blank image creation functionality to Image constructor
@dahlia dahlia merged commit 85e737e into emcconville:master Sep 7, 2012
1 check failed
1 check failed
default The Travis build failed
Details
dahlia added a commit that referenced this pull request Sep 7, 2012
dahlia added a commit that referenced this pull request Sep 7, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

2 participants
You can’t perform that action at this time.