diff --git a/docs/changes.rst b/docs/changes.rst index 7f4dc266..98bfa225 100644 --- a/docs/changes.rst +++ b/docs/changes.rst @@ -16,6 +16,7 @@ Unreleased. - Updated :meth:`Image.fx() ` method to raise :class:`~wand.exceptions.WandRuntimeError` if ImageMagick is unable to generate an image. [:issue:`582`] - Fixed :meth:`Image.from_array() ` classmethod to handle Numpy's strided arrays. [:issue:`582`] + - Fixed segmentation fault with ImageMagick 7.1.0-4X release. [:issue:`586`] .. _changelog-0.6.8: diff --git a/wand/color.py b/wand/color.py index 47fc8cce..b337c2c3 100644 --- a/wand/color.py +++ b/wand/color.py @@ -10,7 +10,7 @@ from .api import library from .cdefs.structures import MagickPixelPacket, PixelInfo from .compat import binary, text -from .resource import Resource +from .resource import Resource, genesis from .version import MAGICK_VERSION_NUMBER, MAGICK_HDRI, QUANTUM_DEPTH __all__ = 'Color', 'scale_quantum_to_int8' @@ -124,6 +124,9 @@ def __getinitargs__(self): def __enter__(self): if self.allocated < 1: + # As of 0x710, we must call MagickWandGenesis before allocate of + # Wand's Resource & ImageMagick PixelWand. + genesis() with self.allocate(): # Initialize resource. self.resource = library.NewPixelWand()