-
Notifications
You must be signed in to change notification settings - Fork 198
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
Fix using wand on Windows, and allow loading of binary blobs #261
Conversation
…indows Binary Release Work around issue on Python 3.5 (ctypes.util.find_msvcrt() is broken)
…rs with the filename, file or blob parameter, which is necessary to load raw image data. Added the depth parameter to specify the image depth in raw images
bytes([1, 2, 3]) doesn't have the desired behaviour in Python 2.x
Sorry for late review. Could you add |
…n setting a fake file name. * allow loading raw pixel data using a file name * add a few extra tests * added version to the docstrings
No problem, I will make the changes. I have made a few extra changes as well, see the last commit on my fork:
I was also thinking of moving some of that new functionality from the constructor into the One outstanding issue is that using |
# yet found a suitable fix for this problem | ||
# | ||
# One proposed solution is subclassing ctypes.c_void_p, but that breaks the | ||
# assert statements. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How does a subclass of c_void_p
break the assert statements? Which asserts?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A subclass is always False
in a boolean expression, even if that pointer is NULL. But I just found out there was a signature missing in api.py
. With that declaration I no longer get that error.
But that being said, I saw the error before when trying to call MagickSetFormat
but I'm not seeing that error anymore. I'll let you know if it comes back.
… that function Add missing test resource
I'm not getting the overflow error anymore. Probably it was caused by the missing definition of |
The broken build was just fixed in upstream master. Could you rebase it on the current master? |
OK, all done. |
@@ -2385,6 +2386,14 @@ class Image(BaseImage): | |||
.. versionadded:: 0.3.0 | |||
The ``resolution`` parameter. | |||
|
|||
.. versionadded:: 4.2.0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It has to be 0.4.2.
Conflicts: wand/image.py
OK, that's fixed. |
CI build was broken due to its code style: $ flake8 .
./wand/api.py:678:39: E128 continuation line under-indented for visual indent
./wand/api.py:682:39: E128 continuation line under-indented for visual indent |
@@ -650,6 +674,14 @@ class AffineMatrix(ctypes.Structure): | |||
ctypes.c_uint] | |||
library.MagickSetSize.restype = ctypes.c_int | |||
|
|||
library.MagickSetDepth.argtypes = [ctypes.c_void_p, | |||
ctypes.c_uint] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
./wand/api.py:678:39: E128 continuation line under-indented for visual indent
Yes, I missed those two, sorry about that. The CI build is now passing. |
Fix using wand on Windows, and allow loading of binary blobs
Merged! Thanks for your effort. 😄 |
No problem, thank you for your time reviewing it. |
FYI it was included in 0.4.2 release.
|
I made some changes to make
wand
work on Python 3.5 on Windows:%MAGICK_HOME%
, but in the registry.I also needed to read images from binary blobs, which requires passing the
width
,height
anddepth
, as well as the actual blob. So I changed theImage()
constructor to accept that combination of arguments.