Bug 326953

Summary: Add loadEmbeddedPreview reading from QBuffer
Product: [Applications] digikam Reporter: Martin Kyral <sine.nomine>
Component: Plugin-DImg-RAWAssignee: Digikam Developers <digikam-bugs-null>
Status: RESOLVED FIXED    
Severity: normal CC: caulier.gilles
Priority: NOR    
Version: 3.5.0   
Target Milestone: ---   
Platform: unspecified   
OS: Linux   
Latest Commit: Version Fixed In: 4.0.0
Sentry Crash Report:
Attachments: proposed patch
patch v2

Description Martin Kyral 2013-10-31 16:11:20 UTC
During implementation of the RAW preview support in gwenview, a need for loadEmbeddedPreview able of loading the RAW data from QBuffer (not file) arose. Temporarily, I've implemented the function within gwenview. For the sake of better maintainability of the code it would be nice to have this feature implemented directly in libkdcraw. Proposed patch is attached.

Reproducible: Always
Comment 1 Martin Kyral 2013-10-31 16:12:02 UTC
Created attachment 83251 [details]
proposed patch
Comment 2 caulier.gilles 2013-10-31 16:17:20 UTC
From your patch you force libkdcraw client application to compile with libraw througn libkdcraw/kdcraw.h header :

+//LibRaw includes
+
+#include <libraw/libraw.h>

This is weird. client application don't need this dependency.
To fix it, move this method :

 private:
+    // implements loadEmbeddedPreview once the LibRaw buffer is opened
+    static bool loadEmbeddedPreview(QByteArray&, LibRaw&);
 
... to kdcraw_p.h/.cpp and remove libraw header include from shared libkdcraw header.

If you update this patch, it will be can included to git/master for next KDE 4.12. Do you have a git developer account ?

Best

Gilles Caulier
Comment 3 Martin Kyral 2013-11-01 11:02:19 UTC
Created attachment 83264 [details]
patch v2
Comment 4 Martin Kyral 2013-11-01 11:04:07 UTC
Thanks for the brief reply. I modified the patch according to your comment.

No, I don't have git developer account.

Rgds,
Martin
Comment 5 caulier.gilles 2013-11-02 13:35:33 UTC
Git commit 84e6c3d3d29d580d9e94dfb68cbb294d43885381 by Gilles Caulier.
Committed on 02/11/2013 at 13:33.
Pushed by cgilles into branch 'master'.

Apply patch #83264 from Martin Kyral to load embedded preview from a QBuffer RAW data container
FIXED-IN: 4.0.0

M  +30   -29   libkdcraw/kdcraw.cpp
M  +6    -0    libkdcraw/kdcraw.h
M  +52   -3    libkdcraw/kdcraw_p.cpp
M  +6    -2    libkdcraw/kdcraw_p.h

http://commits.kde.org/libkdcraw/84e6c3d3d29d580d9e94dfb68cbb294d43885381