-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathedgeMemory.c
44 lines (30 loc) · 953 Bytes
/
edgeMemory.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
//GetImageProperty
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <malloc.h>
#include <wand/MagickWand.h>
void ThrowWandError(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;
MagickWandGenesis();
magick_wand = NewMagickWand();
status = MagickSetSize(magick_wand, 100, 100);
if (status == MagickFalse) {
printf("Failed to set size\n");
return -1;
}
MagickReadImage(magick_wand, "xc:red");
// status = MagickSetImageFormat(magick_wand, "png");
status = MagickWriteImage(magick_wand, "./edge_omgwtf.png");
MagickWandTerminus();
return 0;
}