summaryrefslogtreecommitdiff
blob: e7b9ac15d3c9fdecda3d25fc56124d8e7df3f3cd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
--- dvdauthor/src/subgen-image.c
+++ dvdauthor/src/subgen-image.c
@@ -30,7 +30,7 @@
 
 #if defined(HAVE_MAGICK) || defined(HAVE_GMAGICK)
 #include <stdarg.h>
-#include <magick/api.h>
+#include <MagickWand/MagickWand.h>
 #else
 #include <png.h>
 #endif
@@ -176,18 +176,18 @@
 {
     Image *im;
     ImageInfo *ii;
-    ExceptionInfo ei;
+    ExceptionInfo *ei;
     int x,y;
     unsigned long magickver;
     unsigned char amask;
 
-    GetExceptionInfo(&ei);
+    ei = AcquireExceptionInfo();
     ii=CloneImageInfo(NULL);
     strcpy(ii->filename,s->fname);
-    im=ReadImage(ii,&ei);
+    im=ReadImage(ii,ei);
 
     if( !im ) {
-        MagickError(ei.severity,"Unable to load file",ii->filename);
+        MagickError(ei->severity,"Unable to load file",ii->filename);
         return -1;
     }
 
@@ -202,10 +202,10 @@
     for( y=0; y<im->rows; y++ ) {
         char pdata[MAXX*4];
 
-        if(!ExportImagePixels(im,0,y,im->columns,1,"RGBA",CharPixel,pdata,&ei)) {
-            fprintf(stderr,"ERR:  Extracting row %d from %s (%s,%s)\n",y,s->fname,ei.reason,ei.description);
-            CatchException(&ei);
-            MagickError(ei.severity,ei.reason,ei.description);
+        if(!ExportImagePixels(im,0,y,im->columns,1,"RGBA",CharPixel,pdata,ei)) {
+            fprintf(stderr,"ERR:  Extracting row %d from %s (%s,%s)\n",y,s->fname,ei->reason,ei->description);
+            CatchException(ei);
+            MagickError(ei->severity,ei->reason,ei->description);
             DestroyImage(im);
             return -1;
         }
@@ -219,7 +219,7 @@
         }
     }
     DestroyImage(im);
-    DestroyExceptionInfo(&ei);
+    DestroyExceptionInfo(ei);
     fprintf(stderr,"INFO: Picture %s had %d colors\n",s->fname,s->numpal);
 
     return 0;
@@ -1098,13 +1098,13 @@
 void image_init()
 {
 #if defined(HAVE_MAGICK) || defined(HAVE_GMAGICK)
-    InitializeMagick(NULL);
+    MagickCoreGenesis("", MagickFalse);
 #endif
 }
 
 void image_shutdown()
 {
 #if defined(HAVE_MAGICK) || defined(HAVE_GMAGICK)
-    DestroyMagick();
+    MagickCoreTerminus();
 #endif
 }