Merge pull request #109 from eukara/master

GSImageMagickImageRep: Update to work with ImageMagick 7
This commit is contained in:
Fred Kiefer 2021-09-28 08:14:22 +02:00 committed by GitHub
commit fc5de2023c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -82,11 +82,19 @@
NSSize res;
if (image->units == PixelsPerCentimeterResolution)
{
#if (MagickLibVersion >= 0x700)
res = NSMakeSize(image->resolution.x * 2.54, image->resolution.y * 2.54);
#else
res = NSMakeSize(image->x_resolution * 2.54, image->y_resolution * 2.54);
#endif
}
else
{
#if (MagickLibVersion >= 0x700)
res = NSMakeSize(image->resolution.x, image->resolution.y);
#else
res = NSMakeSize(image->x_resolution, image->y_resolution);
#endif
}
if (res.width > 0 && res.height > 0)
@ -121,7 +129,11 @@
// Set the background color to transparent
// (otherwise SVG's are rendered against a white background by default)
#if (MagickLibVersion >= 0x700)
QueryColorCompliance("none", AllCompliance, &imageinfo->background_color, exception);
#else
QueryColorDatabase("none", &imageinfo->background_color, exception);
#endif
images = BlobToImage(imageinfo, [data bytes], [data length], exception);