Skip to content

Commit

Permalink
Merge 4b0c70b into 48e80c3
Browse files Browse the repository at this point in the history
  • Loading branch information
w-m committed Jul 24, 2013
2 parents 48e80c3 + 4b0c70b commit aceab84
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions wand/color.py
Expand Up @@ -74,15 +74,17 @@ def __init__(self, string=None, raw=None):
if (string is None and raw is None or
string is not None and raw is not None):
raise TypeError('expected one argument')
elif raw is None:
pixel = library.NewPixelWand()
library.PixelSetColor(pixel, binary(string))
raw = ctypes.create_string_buffer(

self.allocated = 0
if raw is None:
self.raw = ctypes.create_string_buffer(
ctypes.sizeof(MagickPixelPacket)
)
library.PixelGetMagickColor(pixel, raw)
self.raw = raw
self.allocated = 0
with self:
library.PixelSetColor(self.resource, binary(string))
library.PixelGetMagickColor(self.resource, self.raw)
else:
self.raw = raw

def __getinitargs__(self):
return self.string, None
Expand Down

0 comments on commit aceab84

Please sign in to comment.