13{
14 if (argc<=2) {
15 printf(
"IccToXml built with IccProfLib Version " ICCPROFLIBVER ", IccLibXML Version " ICCLIBXMLVER "\n\nUsage: IccToXml src_icc_profile dest_xml_file\n");
16 return -1;
17 }
18
21
24
25 if (!srcIO.
Open(argv[1],
"r")) {
26 printf("Unable to open '%s'\n", argv[1]);
27 return -1;
28 }
29
30 if (!profile.Read(&srcIO)) {
31 printf("Unable to read '%s'\n", argv[1]);
32 return -1;
33 }
34
35 std::string xml;
36 xml.reserve(40000000);
37
38 if (!profile.
ToXml(xml)) {
39 printf("Unable to convert '%s' to xml\n", argv[1]);
40 return -1;
41 }
42
43 if (!dstIO.
Open(argv[2],
"wb")) {
44 printf("unable to open '%s'\n", argv[2]);
45 return -1;
46 }
47
49 printf("XML successfully created\n");
50 }
51 else {
52 printf("Unable to write '%s'\n", argv[2]);
53 return -1;
54 }
55
57
58 return 0;
59}
long icInt32Number
Definition icProfileHeader.h:291
#define ICCPROFLIBVER
Definition IccProfLibVer.h:2
#define ICCLIBXMLVER
Definition IccLibXMLVer.h:2
virtual void Close()
Definition IccIO.cpp:443
virtual icInt32Number Write8(void *pBuf, icInt32Number nNum=1)
Definition IccIO.cpp:461
bool Open(const icChar *szFilename, const icChar *szAttr)
Definition IccIO.cpp:382
static void PushFactory(IIccTagFactory *pFactory)
Definition IccTagFactory.h:351
static void PushFactory(IIccMpeFactory *pFactory)
Definition IccMpeFactory.h:245
Definition IccTagXmlFactory.h:87
Definition IccMpeXmlFactory.h:106
Definition IccProfileXml.h:76
bool ToXml(std::string &xmlString)
Definition IccProfileXml.cpp:74