alexcorvi/heic2any

EXIF GPS latitude and longitude are lost when HEIC is converted to jpeg

Opened this issue · 2 comments

ryaa commented

Here is the file that I tried to convert to jpeg (please unzip it to get the original HEIC image) and output jpeg does not contain EXIF GPS data.

cheers.heic.zip

The code is as follows:

        const HEICBlobFile: Blob = await this.makeImageIntoBlob(heicImagePath);

        const JPEGBlobFile: Blob = await heic2any({
            // required: the HEIF blob file
            blob: HEICBlobFile,
            // (optional) MIME type of the target file
            // it can be "image/jpeg", "image/png" or "image/gif"
            // defaults to "image/png"
            toType: 'image/jpeg',
            // conversion quality
            // a number ranging from 0 to 1
            quality: 0.8
        });

and then I save the jpeg file and it has no GPS data in EXIF.

ryaa commented

It seems that EXIF can't be preserved since canvas is used to convert the image.

This is a current limitation of the library. The development process of this library is focusing on viewing a browser-consumable version of a heic file.
So this would typically be solved in the issue.
I'll keep this issue open and note any updates on the process.