Example #1
0
                      'Try to install:\n  ' + msg)

#: (:class:`ctypes.CDLL`) The MagickWand library.
library = libraries[0]

#: (:class:`ctypes.CDLL`) The ImageMagick library.  It is the same with
#: :data:`library` on platforms other than Windows.
#:
#: .. versionadded:: 0.1.10
libmagick = libraries[1]

try:
    from wand.cdefs import (core, magick_wand, magick_image, magick_property,
                            pixel_iterator, pixel_wand, drawing_wand)

    core.load(libmagick)
    # Let's get the magick-version number to pass to load methods.
    IM_VERSION = ctypes.c_size_t()
    libmagick.GetMagickVersion(ctypes.byref(IM_VERSION))
    # Query Quantum Depth (i.e. Q8, Q16, ... etc).
    IM_QUANTUM_DEPTH = ctypes.c_size_t()
    libmagick.GetMagickQuantumDepth(ctypes.byref(IM_QUANTUM_DEPTH))
    # Does the library support HDRI?
    IM_HDRI = 'HDRI' in str(libmagick.GetMagickFeatures())
    core.load_with_version(libmagick, IM_VERSION.value)
    magick_wand.load(library, IM_VERSION.value)
    magick_property.load(library, IM_VERSION.value)
    magick_image.load(library, IM_VERSION.value)
    pixel_iterator.load(library, IM_VERSION.value)
    pixel_wand.load(library, IM_VERSION.value, IM_QUANTUM_DEPTH.value, IM_HDRI)
    drawing_wand.load(library, IM_VERSION.value)
Example #2
0
File: api.py Project: dahlia/wand
                      'Try to install:\n  ' + msg)

#: (:class:`ctypes.CDLL`) The MagickWand library.
library = libraries[0]

#: (:class:`ctypes.CDLL`) The ImageMagick library.  It is the same with
#: :data:`library` on platforms other than Windows.
#:
#: .. versionadded:: 0.1.10
libmagick = libraries[1]

try:
    from wand.cdefs import (core, magick_wand, magick_image, magick_property,
                            pixel_iterator, pixel_wand, drawing_wand)

    core.load(libmagick)
    # Let's get the magick-version number to pass to load methods.
    IM_VERSION = ctypes.c_size_t()
    libmagick.GetMagickVersion(ctypes.byref(IM_VERSION))
    # Query Quantum Depth (i.e. Q8, Q16, ... etc).
    IM_QUANTUM_DEPTH = ctypes.c_size_t()
    libmagick.GetMagickQuantumDepth(ctypes.byref(IM_QUANTUM_DEPTH))
    # Does the library support HDRI?
    IM_HDRI = 'HDRI' in str(libmagick.GetMagickFeatures())
    core.load_with_version(libmagick, IM_VERSION.value)
    magick_wand.load(library, IM_VERSION.value)
    magick_property.load(library, IM_VERSION.value)
    magick_image.load(library, IM_VERSION.value)
    pixel_iterator.load(library, IM_VERSION.value)
    pixel_wand.load(library, IM_VERSION.value, IM_QUANTUM_DEPTH.value, IM_HDRI)
    drawing_wand.load(library, IM_VERSION.value)