/[public]/psiconv/trunk/program/psiconv/gen_image.c
ViewVC logotype

Diff of /psiconv/trunk/program/psiconv/gen_image.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

Revision 249 Revision 343
1/* 1/*
2 * gen_image.c - Part of psiconv, a PSION 5 file formats converter 2 * gen_image.c - Part of psiconv, a PSION 5 file formats converter
3 * Copyright (c) 1999-2004 Frodo Looijaard <frodol@dds.nl> 3 * Copyright (c) 1999-2005 Frodo Looijaard <frodo@frodo.looijaard.name>
4 * 4 *
5 * This program is free software; you can redistribute it and/or modify 5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by 6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or 7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version. 8 * (at your option) any later version.
24#include <string.h> 24#include <string.h>
25#include <stdlib.h> 25#include <stdlib.h>
26 26
27#ifdef IMAGEMAGICK 27#ifdef IMAGEMAGICK
28#include "magick-aux.h" 28#include "magick-aux.h"
29#include <magick/magick.h>
30#endif 29#endif
31 30
32#ifdef DMALLOC 31#ifdef DMALLOC
33#include "dmalloc.h" 32#include "dmalloc.h"
34#endif 33#endif
90 ImageInfo *image_info; 89 ImageInfo *image_info;
91 ExceptionInfo exc; 90 ExceptionInfo exc;
92 size_t length; 91 size_t length;
93 char *data; 92 char *data;
94 int i; 93 int i;
95 94
96 strcpy(image->magick,dest); 95 strcpy(image->magick,dest);
97 image_info = CloneImageInfo(NULL); 96 image_info = CloneImageInfo(NULL);
98 GetExceptionInfo(&exc); 97 GetExceptionInfo(&exc);
99 data = ImageToBlob(image_info,image,&length,&exc); 98 data = ImageToBlob(image_info,image,&length,&exc);
100 if (!data || (exc.severity != UndefinedException)) { 99 if (!data || (exc.severity != UndefinedException)) {
234 233
235void init_image(void) 234void init_image(void)
236{ 235{
237 struct fileformat_s ff; 236 struct fileformat_s ff;
238#if IMAGEMAGICK 237#if IMAGEMAGICK
239 const MagickInfo *mi; 238 const MagickInfo **mi;
239 int i;
240#if IMAGEMAGICK_API == 100
241 InitializeMagick(NULL);
242#endif
240 ff.output = gen_image; 243 ff.output = gen_image;
241 for (mi = GetMagickFileList(); mi ; mi = mi->next) { 244 mi = GetMagickFileList();
245 i = 0;
246 while (mi[i]) {
242 if (mi->encoder) { 247 if (mi[i]->encoder) {
243 ff.name = strdup(mi->name); 248 ff.name = strdup(mi[i]->name);
244 ff.description = strdup(mi->description); 249 ff.description = strdup(mi[i]->description);
245 ff.supported_format = FORMAT_CLIPART_SINGLE | FORMAT_MBM_SINGLE | 250 ff.supported_format = FORMAT_CLIPART_SINGLE | FORMAT_MBM_SINGLE |
246 FORMAT_SKETCH; 251 FORMAT_SKETCH;
247 if (mi->adjoin) 252 if (mi[i]->adjoin)
248 ff.supported_format |= FORMAT_MBM_MULTIPLE | FORMAT_CLIPART_MULTIPLE; 253 ff.supported_format |= FORMAT_MBM_MULTIPLE | FORMAT_CLIPART_MULTIPLE;
249 psiconv_list_add(fileformat_list,&ff); 254 psiconv_list_add(fileformat_list,&ff);
250 } 255 }
256 i++;
251 } 257 }
252#endif 258#endif
253} 259}
254 260

Legend:
Removed from v.249  
changed lines
  Added in v.343

frodo@frodo.looijaard.name
ViewVC Help
Powered by ViewVC 1.1.26