mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
...
This commit is contained in:
parent
5d3418f22c
commit
7a89cfe702
@ -23,16 +23,16 @@ class Severity(ctypes.c_long):
|
|||||||
pass
|
pass
|
||||||
|
|
||||||
class String(ctypes.c_char_p):
|
class String(ctypes.c_char_p):
|
||||||
|
|
||||||
def __del__(self):
|
def __del__(self):
|
||||||
_libwand.MagickRelinquishMemory(self)
|
_libwand.MagickRelinquishMemory(self)
|
||||||
|
|
||||||
def __str__(self):
|
def __str__(self):
|
||||||
return self.value
|
return self.value
|
||||||
|
|
||||||
if _libwand is not None:
|
if _libwand is not None:
|
||||||
_libwand.MagickGetException.argtypes = [ctypes.c_void_p, ctypes.POINTER(Severity)]
|
_libwand.MagickGetException.argtypes = [ctypes.c_void_p, ctypes.POINTER(Severity)]
|
||||||
_libwand.MagickGetException.restype = String
|
_libwand.MagickGetException.restype = String
|
||||||
|
|
||||||
def get_exception(wand):
|
def get_exception(wand):
|
||||||
severity = Severity()
|
severity = Severity()
|
||||||
@ -52,4 +52,4 @@ def convert(source, dest):
|
|||||||
if not _libwand.MagickWriteImage(wand, dest):
|
if not _libwand.MagickWriteImage(wand, dest):
|
||||||
raise WandException('Cannot write image to file %s: %s'%(source, get_exception(wand)))
|
raise WandException('Cannot write image to file %s: %s'%(source, get_exception(wand)))
|
||||||
_libwand.DestroyMagickWand(wand)
|
_libwand.DestroyMagickWand(wand)
|
||||||
_libwand.MagickWandTerminus()
|
_libwand.MagickWandTerminus()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user