Read and set the ICC profile ID.
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
typedef struct oyProfile_s_ oyProfile_s_;
int oyProfile_ToFile_ ( oyProfile_s_ * profile,
const char * file_name );
int main( int argc, char ** argv )
{
uint32_t * i;
uint32_t md5[4],
id[4];
int profile_pos = 1,
set_md5 = 0,
show_short = 0,
error;
if(argc == 1)
{
printf("Usage: %s [--set] [--short] icc_profile.icc\n", argv[0]);
exit(0);
}
if(strcmp(argv[profile_pos],"--set") == 0)
{
set_md5 = 1;
++profile_pos;
}
if(strcmp(argv[profile_pos],"--short") == 0)
{
show_short = 1;
++profile_pos;
}
if(set_md5)
oyProfile_ToFile_( (oyProfile_s_*)p, argv[profile_pos]);
i = (uint32_t*)md5;
if(p)
{
if(show_short)
printf( "%08x%08x%08x%08x\n",
(unsigned int)i[0],(unsigned int)i[1],(unsigned int)i[2],(unsigned int)i[3] );
else
printf( "%08x%08x%08x%08x[%08x%08x%08x%08x] %s\n",
(unsigned int)i[0],(unsigned int)i[1],(unsigned int)i[2],(unsigned int)i[3],
(unsigned int)id[0],(unsigned int)id[1],(unsigned int)id[2],(unsigned int)id[3], argv[profile_pos] );
} else
fprintf(stderr, "not found: %s\n", argv[profile_pos] );
return error;
}