-
Notifications
You must be signed in to change notification settings - Fork 0
/
registry.c
77 lines (53 loc) · 1.77 KB
/
registry.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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
//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;
char filename[2048];
memset(filename, 0, 2048);
// ImageInfo *image_info;
// Image *image;
char *value;
char *key = "temporary-path";
MagickWandGenesis();
GetPathTemplate(filename);
printf("filename is %s\n", filename);
value = GetImageRegistry(StringRegistryType, key, NULL);
printf("Value is %s \n", value);
status = SetImageRegistry(StringRegistryType, key, "/temp/fark", NULL);
value = GetImageRegistry(StringRegistryType, key, NULL);
printf("Value is %s\n", value);
GetPathTemplate(filename);
printf("filename is %s\n", filename);
// image_info = AcquireImageInfo();
//
// 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;
}