forked from haasn/cms
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathimtest.c
37 lines (28 loc) · 812 Bytes
/
imtest.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
#include <stdio.h>
#include <string.h>
#include <magick/MagickCore.h>
int main(int argc, char **argv)
{
if (argc != 2) exit(1);
MagickCoreGenesis(*argv, MagickFalse);
ImageInfo *info = AcquireImageInfo();
ExceptionInfo *err = AcquireExceptionInfo();
strcpy(info->filename, argv[1]);
Image *img = PingImage(info, err);
if (img == NULL) {
printf("failed opening\n");
exit(0);
}
StringInfo *pinfo = GetImageProfile(img, "ICC");
if (pinfo == NULL) {
printf("NULL\n");
exit(0);
}
//printf("path=%s, len=%zu, sig=%zu\n", pinfo->datum, pinfo->length, pinfo->signature);
fwrite(pinfo->datum, sizeof(unsigned char), pinfo->length, stdout);
DestroyStringInfo(pinfo);
DestroyImage(img);
DestroyImageInfo(info);
DestroyExceptionInfo(err);
MagickCoreTerminus();
}