[Digikam-devel] [Bug 271323] Digikam crashes when building thumbnails of grayscale DNGs

Alex Tutubalin lexa at lexa.ru
Fri May 27 08:08:09 BST 2011


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





--- Comment #10 from Alex Tutubalin <lexa lexa ru>  2011-05-27 09:08:08 ---
For dcraw_make_mem_image call you *should* take libraw_processed_image_t.colors
field into account. For grayscale image this field is equal to 1 and bitmap
allocated according to exact color count:
 === quote from source ===
unsigned ds = S.height * S.width * (O.output_bps/8) * P1.colors;
libraw_processed_image_t *ret =
(libraw_processed_image_t*)::malloc(sizeof(libraw_processed_image_t)+ds);
...
ret->colors = P1.colors;

For thumbnail things are simpler:
 for libraw_processed_image_t.type == LIBRAW_THUMBNAIL_BITMAP  the
libraw_processed_image_t.colors is always 3
 and for libraw_processed_image_t.type == LIBRAW_THUMBNAIL_JPEG the thumbnail
is JPEG data (libraw does not analyse this type of thumbnails)

-- 
Configure bugmail: https://bugs.kde.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the Digikam-devel mailing list