emmcb / cxx-image

A flexible and lightweight image processing library written in modern C++17.
Apache License 2.0
2 stars 2 forks source link

POC of writing preview and thumbnail image in DNG file #4

Closed sygslhy closed 6 days ago

sygslhy commented 3 weeks ago

Hello,

One of the users in python 'cxx-image-io' package wants export .dng file, but it often has some display issue in his image viewer or post processing software.

I investigated and noticed our DngIO writes the .dng file however it contains only full-resolution image, it isn't with thumbnail or preview image so it is reason why some image viewer refuse to open or display it.

I happened to find part of code in dng_validate.cpp that generates the thumbnail and preview image. it has 2 steps :

  1. build stage2 and stage3 images,
  2. based on the stage3 RGB image it rends a 256 width's thumbnail and a JPEG compressed 1024 width's preview.
  3. append some relative exif of previews.

I tested this branch with the dng file you gave to me, then have a preview and thumbnail. views

Here is some thumbnail and preview information in exif:

preview_exif thumbnail_exif

sygslhy commented 2 weeks ago

@emmcb Hello, any review or comments on this PR?