Another interesting heif conversion issue

By: Eric Joyner
Created: July 7, 2025, 11:23 a.m.

Tags: photo, heif2jpg,

I think the images I upload from my camera are kind of a little big for just generic web content (they're 24 megapixles), so I wanted to experiment with resizing them down to something smaller, and then converting them to jpegs.

So, to try it out, I shrunk the image using Nikon's NX Studio to something like 1620x1080 pixels (which is what Nikon uses for 2MP pictures in Snapbridge) and then converted it using heif2jpg, but I got this fun result:

It was surprising, so I converted the full-size image and got what I expected:

I was pretty befuddled.

I did take a look at the p010 output from the heif decode in a tool called PixelViewer (and had to fix an issue with how it displayed P010 output), and it was corrupted there, so it looks like it's an issue with the heif being decoded, and not the encoding to a jpeg. But I have no idea what went wrong; does NX studio do something strange with the metadata when it encodes the new, shrunk image? I did try opening the shrunk picture HEIF file in Affinity Photo 2 and it looked totally fine, so maybe there's something weird going on in libheif or libde265 in how it's decoding either the HEIF container or the actual HEVC-encoded picture data...