const char file_path[] = "D:/studyplace/workplace/cpp/resource/9.jpg";
const char result_path[] = "D:/studyplace/workplace/cpp/resource/tmp.jpg";
int magick_exif()
{
int rc = 0;
MagickWand* magick_wand = NULL;
char* exif_data;
MagickWandGenesis();
magick_wand = NewMagickWand();
if (MagickReadImage(magick_wand, file_path) == MagickFalse) {
printf("Failed to read image\n");
rc = -1;
goto l_out;
}
exif_data = MagickGetImageProperty(magick_wand, "exif:Make");
if (NULL == exif_data)
{
printf("there is no this info\n");
rc = -1;
goto l_e_free;
}
printf("exif:%s\n", exif_data);
magick_wand = DestroyMagickWand(magick_wand);
l_out:
MagickWandTerminus();
return rc;
l_e_free:
magick_wand = DestroyMagickWand(magick_wand);
goto l_out;
}
int main() {
magick_exif();
return 0;
}