-
Notifications
You must be signed in to change notification settings - Fork 0
/
property.c
53 lines (37 loc) · 1.24 KB
/
property.c
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
//GetImageProperty
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <malloc.h>
#include <wand/MagickWand.h>
void ThrowWandException(MagickWand *wand) {
char *description;
ExceptionType severity;
description = MagickGetException(wand, &severity);
(void) fprintf(stderr,"%s %s %lu %s\n",GetMagickModule(),description);
description=(char *) MagickRelinquishMemory(description);
exit(-1);
}
int main(int argc,char **argv) {
MagickWand *magick_wand;
MagickBooleanType status;
const char *result;
ImageInfo *image_info;
Image *image;
char *property;
image_info = AcquireImageInfo();
MagickWandGenesis();
magick_wand = NewMagickWand();
status = MagickReadImage(magick_wand, "./images/mask.png");
image = GetImageFromMagickWand(magick_wand);
//result = InterpretImageProperties(image_info, image, "%@");
ResetImagePropertyIterator(image);
while((property = GetNextImageProperty(image))) {
result = GetImageProperty(image, property);
printf("Property: %s value: %s\n", property, result);
}
//printf("Result is: %s", result);
image_info=DestroyImageInfo(image_info);
MagickWandTerminus();
return 0;
}