-
Notifications
You must be signed in to change notification settings - Fork 5
Open
Labels
bugSomething isn't workingSomething isn't working
Description
After decoding the HEIC picture with this library, all the meta information is lost. I wonder if other information except the rotation field can be retained?
After reviewing the libheif source code, I found the following method:
size_t exifsize = 0;
uint8_t* exifdata = GetExifMetaData(handle, &exifsize);
if (exifdata && exifsize > 4) {
static const uint8_t kExifMarker = JPEG_APP0 + 1;
jpeg_write_marker(&cinfo, kExifMarker, exifdata + 4,
static_cast<unsigned int>(exifsize - 4));
free(exifdata);
}
size_t profile_size = heif_image_handle_get_raw_color_profile_size(handle);
if (profile_size > 0) {
uint8_t* profile_data = static_cast<uint8_t*>(malloc(profile_size));
heif_image_handle_get_raw_color_profile(handle, profile_data);
jpeg_write_icc_profile(&cinfo, profile_data, (unsigned int) profile_size);
free(profile_data);
}
if (heif_image_get_bits_per_pixel(image, heif_channel_Y) != 8) {
fprintf(stderr, "JPEG writer cannot handle image with >8 bpp.\n");
return false;
}
.......
But my C++ is very poor, do not know how to convert to OC code,any body have some idea? i'll be very thankful!
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working