Lines 30-36
Link Here
|
30 |
|
30 |
|
31 |
#if defined(HAVE_MAGICK) || defined(HAVE_GMAGICK) |
31 |
#if defined(HAVE_MAGICK) || defined(HAVE_GMAGICK) |
32 |
#include <stdarg.h> |
32 |
#include <stdarg.h> |
33 |
#include <magick/api.h> |
33 |
#include <MagickWand/MagickWand.h> |
34 |
#else |
34 |
#else |
35 |
#include <png.h> |
35 |
#include <png.h> |
36 |
#endif |
36 |
#endif |
Lines 176-193
Link Here
|
176 |
{ |
176 |
{ |
177 |
Image *im; |
177 |
Image *im; |
178 |
ImageInfo *ii; |
178 |
ImageInfo *ii; |
179 |
ExceptionInfo ei; |
179 |
ExceptionInfo *ei; |
180 |
int x,y; |
180 |
int x,y; |
181 |
unsigned long magickver; |
181 |
unsigned long magickver; |
182 |
unsigned char amask; |
182 |
unsigned char amask; |
183 |
|
183 |
|
184 |
GetExceptionInfo(&ei); |
184 |
ei = AcquireExceptionInfo(); |
185 |
ii=CloneImageInfo(NULL); |
185 |
ii=CloneImageInfo(NULL); |
186 |
strcpy(ii->filename,s->fname); |
186 |
strcpy(ii->filename,s->fname); |
187 |
im=ReadImage(ii,&ei); |
187 |
im=ReadImage(ii,ei); |
188 |
|
188 |
|
189 |
if( !im ) { |
189 |
if( !im ) { |
190 |
MagickError(ei.severity,"Unable to load file",ii->filename); |
190 |
MagickError(ei->severity,"Unable to load file",ii->filename); |
191 |
return -1; |
191 |
return -1; |
192 |
} |
192 |
} |
193 |
|
193 |
|
Lines 202-211
Link Here
|
202 |
for( y=0; y<im->rows; y++ ) { |
202 |
for( y=0; y<im->rows; y++ ) { |
203 |
char pdata[MAXX*4]; |
203 |
char pdata[MAXX*4]; |
204 |
|
204 |
|
205 |
if(!ExportImagePixels(im,0,y,im->columns,1,"RGBA",CharPixel,pdata,&ei)) { |
205 |
if(!ExportImagePixels(im,0,y,im->columns,1,"RGBA",CharPixel,pdata,ei)) { |
206 |
fprintf(stderr,"ERR: Extracting row %d from %s (%s,%s)\n",y,s->fname,ei.reason,ei.description); |
206 |
fprintf(stderr,"ERR: Extracting row %d from %s (%s,%s)\n",y,s->fname,ei->reason,ei->description); |
207 |
CatchException(&ei); |
207 |
CatchException(ei); |
208 |
MagickError(ei.severity,ei.reason,ei.description); |
208 |
MagickError(ei->severity,ei->reason,ei->description); |
209 |
DestroyImage(im); |
209 |
DestroyImage(im); |
210 |
return -1; |
210 |
return -1; |
211 |
} |
211 |
} |
Lines 219-225
Link Here
|
219 |
} |
219 |
} |
220 |
} |
220 |
} |
221 |
DestroyImage(im); |
221 |
DestroyImage(im); |
222 |
DestroyExceptionInfo(&ei); |
222 |
DestroyExceptionInfo(ei); |
223 |
fprintf(stderr,"INFO: Picture %s had %d colors\n",s->fname,s->numpal); |
223 |
fprintf(stderr,"INFO: Picture %s had %d colors\n",s->fname,s->numpal); |
224 |
|
224 |
|
225 |
return 0; |
225 |
return 0; |
Lines 1098-1110
Link Here
|
1098 |
void image_init() |
1098 |
void image_init() |
1099 |
{ |
1099 |
{ |
1100 |
#if defined(HAVE_MAGICK) || defined(HAVE_GMAGICK) |
1100 |
#if defined(HAVE_MAGICK) || defined(HAVE_GMAGICK) |
1101 |
InitializeMagick(NULL); |
1101 |
MagickCoreGenesis("", MagickFalse); |
1102 |
#endif |
1102 |
#endif |
1103 |
} |
1103 |
} |
1104 |
|
1104 |
|
1105 |
void image_shutdown() |
1105 |
void image_shutdown() |
1106 |
{ |
1106 |
{ |
1107 |
#if defined(HAVE_MAGICK) || defined(HAVE_GMAGICK) |
1107 |
#if defined(HAVE_MAGICK) || defined(HAVE_GMAGICK) |
1108 |
DestroyMagick(); |
1108 |
MagickCoreTerminus(); |
1109 |
#endif |
1109 |
#endif |
1110 |
} |
1110 |
} |