]>
Commit | Line | Data |
---|---|---|
c49f8907 JR |
1 | diff -ur fail-2.0.1/failmagick.c fail-2.0.1-im7/failmagick.c |
2 | --- fail-2.0.1/failmagick.c 2013-03-20 10:14:11.000000000 +0100 | |
3 | +++ fail-2.0.1-im7/failmagick.c 2016-12-26 11:22:35.114121922 +0100 | |
4 | @@ -23,23 +23,24 @@ | |
5 | ||
6 | #include "fail.h" | |
7 | ||
8 | -#include "magick/studio.h" | |
9 | -#include "magick/blob.h" | |
10 | -#include "magick/blob-private.h" | |
11 | -#include "magick/colorspace.h" | |
12 | -#include "magick/exception.h" | |
13 | -#include "magick/exception-private.h" | |
14 | -#include "magick/image.h" | |
15 | -#include "magick/image-private.h" | |
16 | -#include "magick/list.h" | |
17 | -#include "magick/magick.h" | |
18 | -#include "magick/memory_.h" | |
19 | -#include "magick/monitor.h" | |
20 | -#include "magick/monitor-private.h" | |
21 | -#include "magick/quantum-private.h" | |
22 | -#include "magick/static.h" | |
23 | -#include "magick/string_.h" | |
24 | -#include "magick/module.h" | |
25 | +#include "MagickCore/studio.h" | |
26 | +#include "MagickCore/blob.h" | |
27 | +#include "MagickCore/blob-private.h" | |
28 | +#include "MagickCore/colorspace.h" | |
29 | +#include "MagickCore/exception.h" | |
30 | +#include "MagickCore/exception-private.h" | |
31 | +#include "MagickCore/image.h" | |
32 | +#include "MagickCore/image-private.h" | |
33 | +#include "MagickCore/list.h" | |
34 | +#include "MagickCore/magick.h" | |
35 | +#include "MagickCore/memory_.h" | |
36 | +#include "MagickCore/monitor.h" | |
37 | +#include "MagickCore/monitor-private.h" | |
38 | +#include "MagickCore/pixel-accessor.h" | |
39 | +#include "MagickCore/quantum-private.h" | |
40 | +#include "MagickCore/static.h" | |
41 | +#include "MagickCore/string_.h" | |
42 | +#include "MagickCore/module.h" | |
43 | ||
44 | static MagickBooleanType IsFAIL(const unsigned char *magick, const size_t length) | |
45 | { | |
46 | @@ -53,18 +54,18 @@ | |
47 | int content_len; | |
48 | FAIL *fail; | |
49 | Image *image; | |
50 | - PixelPacket *q; | |
51 | + Quantum *q; | |
52 | const int *pixels; | |
53 | int num_pixels; | |
54 | int i; | |
55 | ||
56 | assert(image_info != NULL); | |
57 | - assert(image_info->signature == MagickSignature); | |
58 | + assert(image_info->signature == MagickCoreSignature); | |
59 | if (image_info->debug) | |
60 | LogMagickEvent(TraceEvent, GetMagickModule(), "%s", image_info->filename); | |
61 | assert(exception != NULL); | |
62 | - assert(exception->signature == MagickSignature); | |
63 | - image = AcquireImage(image_info); | |
64 | + assert(exception->signature == MagickCoreSignature); | |
65 | + image = AcquireImage(image_info, exception); | |
66 | if (!OpenBlob(image_info, image, ReadBinaryBlobMode, exception)) { | |
67 | (void) DestroyImageList(image); | |
68 | return NULL; | |
69 | @@ -82,8 +83,7 @@ | |
70 | } | |
71 | ||
72 | image->depth = 8; | |
73 | - if (!SetImageExtent(image, FAIL_GetWidth(fail), FAIL_GetHeight(fail))) { | |
74 | - InheritException(exception, &image->exception); | |
75 | + if (!SetImageExtent(image, FAIL_GetWidth(fail), FAIL_GetHeight(fail), exception)) { | |
76 | FAIL_Delete(fail); | |
77 | (void) DestroyImageList(image); | |
78 | return NULL; | |
79 | @@ -100,9 +100,10 @@ | |
80 | num_pixels = image->columns * image->rows; | |
81 | for (i = 0; i < num_pixels; i++) { | |
82 | int rgb = pixels[i]; | |
83 | - q[i].red = ScaleCharToQuantum((unsigned char) (rgb >> 16)); | |
84 | - q[i].green = ScaleCharToQuantum((unsigned char) (rgb >> 8)); | |
85 | - q[i].blue = ScaleCharToQuantum((unsigned char) rgb); | |
86 | + SetPixelRed(image, ScaleCharToQuantum((unsigned char) (rgb >> 16)), q); | |
87 | + SetPixelGreen(image, ScaleCharToQuantum((unsigned char) (rgb >> 8)), q); | |
88 | + SetPixelBlue(image, ScaleCharToQuantum((unsigned char) rgb), q); | |
89 | + q += GetPixelChannels(image); | |
90 | } | |
91 | FAIL_Delete(fail); | |
92 | SyncAuthenticPixels(image, exception); | |
93 | @@ -250,7 +251,7 @@ | |
94 | const struct Format *pf; | |
95 | MagickInfo *entry; | |
96 | for (pf = formats; pf < formats + sizeof(formats) / sizeof(formats[0]); pf++) { | |
97 | - entry = SetMagickInfo(pf->name); | |
98 | + entry = AcquireMagickInfo(ConstantString("FAIL"), pf->name, pf->description); | |
99 | entry->decoder = ReadFAILImage; | |
100 | entry->magick = IsFAIL; | |
101 | entry->description = ConstantString(pf->description); |