| 1 |
#include <stdio.h> |
| 2 |
#include <MagickWand/MagickWand.h> |
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
void ThrowWandException(MagickWand *wand) |
| 9 |
{ char |
| 10 |
*description; |
| 11 |
|
| 12 |
ExceptionType |
| 13 |
severity; |
| 14 |
|
| 15 |
description=MagickGetException(wand,&severity); |
| 16 |
(void) fprintf(stderr,"%s %s %lu %s\n",GetMagickModule(),description); |
| 17 |
description=(char *) MagickRelinquishMemory(description); |
| 18 |
} |
| 19 |
|
| 20 |
|
| 21 |
#define SwapWands(a,b) { MagickWand *tmp=a; a=b; b=tmp; } |
| 22 |
|
| 23 |
int main(int argc, char *argv[]) |
| 24 |
{ |
| 25 |
MagickWand |
| 26 |
*wand, |
| 27 |
*output; |
| 28 |
|
| 29 |
MagickBooleanType |
| 30 |
status; |
| 31 |
|
| 32 |
printf("Check append when using 'LastIterator' on empty wand\n"); |
| 33 |
printf("Result should be: 0123\n"); |
| 34 |
|
| 35 |
MagickWandGenesis(); |
| 36 |
|
| 37 |
wand = NewMagickWand(); |
| 38 |
|
| 39 |
MagickSetLastIterator(wand); |
| 40 |
|
| 41 |
status = MagickReadImage(wand, "font_0.gif" ); |
| 42 |
if (status == MagickFalse) |
| 43 |
ThrowWandException(wand); |
| 44 |
|
| 45 |
status = MagickReadImage(wand, "font_1.gif" ); |
| 46 |
if (status == MagickFalse) |
| 47 |
ThrowWandException(wand); |
| 48 |
|
| 49 |
status = MagickReadImage(wand, "font_2.gif" ); |
| 50 |
if (status == MagickFalse) |
| 51 |
ThrowWandException(wand); |
| 52 |
|
| 53 |
status = MagickReadImage(wand, "font_3.gif" ); |
| 54 |
if (status == MagickFalse) |
| 55 |
ThrowWandException(wand); |
| 56 |
|
| 57 |
|
| 58 |
MagickResetIterator(wand); |
| 59 |
output = MagickAppendImages(wand,MagickFalse); |
| 60 |
wand = DestroyMagickWand(wand); |
| 61 |
|
| 62 |
|
| 63 |
status = MagickWriteImage(output,"show:"); |
| 64 |
if (status == MagickFalse) |
| 65 |
ThrowWandException(output); |
| 66 |
|
| 67 |
output = DestroyMagickWand(output); |
| 68 |
|
| 69 |
MagickWandTerminus(); |
| 70 |
} |
| 71 |
|