HEIC Exif tags not being saved to JPEG

Post any defects you find in the released or beta versions of the ImageMagick software here. Include the ImageMagick version, OS, and any command-line required to reproduce the problem. Got a patch for a bug? Post it here.
Post Reply
catboli
Posts: 1
Joined: 2018-07-22T23:05:55-07:00
Authentication code: 1152

HEIC Exif tags not being saved to JPEG

Post by catboli »

Hi!

First, thanks so much for ImageMagick!

I'm using ImageMagick to convert from HEIC (iPhone photo) into JPEG. I'm using Ubuntu 16.04 but I compiled ImageMagick myself from git and I also tried ImageMagick-7.0.8-6.

$ git show HEAD
commit 712c8bc4bcb5fa0694f5c169630f3b4b122862c5

I built libexif and compiled ImageMagick like this:
./configure --prefix=/home/catboli/ImageMagick/build --with-libheif --with-jpeg --enable-debug ; make ; make install

Then, I tried using convert:
./convert ~/IMG_0001.heic ~/out.JPG

This works but I don't get any Exif metadata on the output:
./identify -format '%[EXIF:*]' ~/out.JPG
(prints nothing)

But the funny thing is that identify works on the HEIC file itself:

./identify -format '%[EXIF:*]' ~/IMG_0001.HEIC
....
exif:WhiteBalance=0
exif:XResolution=72/1
exif:YCbCrPositioning=1
exif:YResolution=72/1

Using exiftool I'm able to copy the tags from the HEIC into the JPEG but I have to nuke the file metadata with mogrify before:

./mogrify ~/out.JPG
exiftool -TagsFromFile ~/IMG_0001.heic ~/out.JPG

Let me know if there's anything else I could do to help debugging (if it is a bug).
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: HEIC Exif tags not being saved to JPEG

Post by snibgo »

catboli wrote:Let me know if there's anything else I could do to help debugging (if it is a bug).
For people who have libheif (I don't) a link to a sample input would help.
snibgo's IM pages: im.snibgo.com
Post Reply