https://bugs.kde.org/show_bug.cgi?id=527684
Bug ID: 527684
Summary: Face thumbnails of lossless-compressed Sony ARW files
are cropped from wrong area
Classification: Applications
Product: digikam
Version First 9.1.0
Reported In:
Platform: Debian testing
OS: Linux
Status: REPORTED
Severity: normal
Priority: NOR
Component: Faces-Workflow
Assignee: [email protected]
Reporter: [email protected]
Target Milestone: ---
Created attachment 197557
--> https://bugs.kde.org/attachment.cgi?id=197557&action=edit
People view (master cb31e36b97, unpatched): face thumbnail cut from above the
face (tablet bezel at the top, face cut off at the mouth)
DESCRIPTION
For Sony lossless compressed RAW files the face thumbnails shown in People view
are
slightly off of the actual face area. The crop is clearly above and slightly to
the left
of the selected area. In the image preview the drawn rectangle sits correctly
on the face
and only the thumbnail crop is off. Issue exists in 9.1.0 (Debian package) on
my photos and
I managed to reproduce it with a test file on master @ cb31e36b97 (screenshots
are from
there).
STEPS TO REPRODUCE
1. Add a lossless-compressed Sony RAW with a face in it to a collection. I have
got a test file
that produces the issue taken with Sony ILCE-7M4 firmware 6.02. Filesize is
around 41MB which is too large to attach here but I can provide it on
request.
2. Run face detection on the image.
3. Open the People view and look at the unconfirmed/assigned face thumbnail.
OBSERVED RESULT
The thumbnail shows slightly off area above and to the left. The vertical
offset
is around 8.4% of the face's y coordinate and about 2% of x. Screenshot
current-slightly-off-version.jpg shows the offset while
current-image-preview.jpg
shows face rectangle correctly located in the preview view.
EXPECTED RESULT
The thumbnail image shows the same area that is in the previews rectangle.
SOFTWARE/OS VERSIONS
Operating System: Debian GNU/Linux forky/sid (Xcb), kernel 7.1.13+deb14-amd64,
x86_64
digiKam: 9.1.0 (Debian package), also master cb31e36b97 (9.2.0-dev) with no
local
changes (screenshots)
KDE Frameworks: 6.30.0
Qt: 6.11.2 (built against 6.11.2)
Exiv2: 0.28.9
LibRaw: 0.22.0 (bundled with digiKam)
ADDITIONAL INFORMATION
The issue arises from the way image dimensions are stored in the image
metadata.
Sony lossless-compressed RAW stores the size of the 512x512 tile grid
(including
padding) in ImageWidth and ImageLength tags. The face
rectangles are calculated from the real image size stored in the database but
the
thumbnail code scales using the padded size which shifts the crop. For
the test image the following sizes were observed:
width
height
digiKam Properties / LibRaw 7028 4688
ImageWidth/ImageLength (Exif.SubImage1) 7168 5120
Embedded JPEG preview (Exif.Image2) 7008 4672
That also explains why the offset is mostly vertical (4688 vs 5120), and
probably
why files without lossless compression are not affected (e.g. the a7R III in
bug
447767).
--
You are receiving this mail because:
You are watching all bug changes.