https://bugs.kde.org/show_bug.cgi?id=527684

--- Comment #6 from Heikki Kalliokoski <[email protected]> ---
Hi Maik, hi Gilles,

Thanks for looking at this. 

I do not think this is the same case as in 447767 (16:9), though. My test file
was shot in 3:2 and I verified with exiftool and what digiKam reports and every
size involved is in 3:2:

  Source                                                        width  height
  digiKam Properties / LibRaw                     7028    4688  (3:2)
  Embedded JPEG preview                            7008    4672  (3:2)
  ImageWidth/ImageLength (raw SubIFD)   7168    5120  (512-px tile grid)

The face rectangle shown in the preview is drawn in the right place so
detection is working fine. Only the face thumbnail (People view, tag icon) is
wrong. Thumbnail is created in ThumbnailCreator::loadImageDetail(), which
scales the rectangle from MetaEnginePreviews::originalSize(). That comes from
Exiv2 which for lossless-compressed ARW is the tile-padded 7168x5120. The face
rectangle coordinates however use the DB stored, LibRaw originating 7028x4688,
so the crop ends up about 8% too high relative to the face's position, matching
the 4688 vs 5120 difference.

Gilles: I tested digiKam-9.2.0-20261023T163550-Qt6-x86-64.appimage from a blank
slate with the same file. Issue still persists. LibRaw is not used for the size
in this code path and the AppImage ships Exiv2 0.28.9.

The part of 447767 that matches this is from comment 31 onwards (box correct,
thumbnail shifted), not the original 16:9 detection issue. Curtis also
confirmed in comment 37 that he shoots in 3:2, not 16:9. The fix there (comment
36) changed detection and does not touch this code.

My fix uses the image size from the database for RAW images when available and
falls back to the existing Fujifilm and Exiv2 sizes:  
https://invent.kde.org/heikkikalliokoski/digikam/-/tree/fix-arw-face-crop-offset
Uncompressed ARW, CR3, NEF, RAF and RW2 still crop correctly with it.

Could you reopen this bug, or should I continue in 447767? I'll open the merge
request either way.

Best regards,
Heikki

-- 
You are receiving this mail because:
You are watching all bug changes.

Reply via email to