Bug 326953 - Add loadEmbeddedPreview reading from QBuffer
Summary: Add loadEmbeddedPreview reading from QBuffer
Status: RESOLVED FIXED
Alias: None
Product: digikam
Classification: Applications
Component: Plugin-DImg-RAW (show other bugs)
Version: 3.5.0
Platform: unspecified Linux
: NOR normal
Target Milestone: ---
Assignee: Digikam Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-10-31 16:11 UTC by Martin Kyral
Modified: 2013-11-02 13:35 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In: 4.0.0


Attachments
proposed patch (2.66 KB, patch)
2013-10-31 16:12 UTC, Martin Kyral
Details
patch v2 (4.75 KB, patch)
2013-11-01 11:02 UTC, Martin Kyral
Details

Note You need to log in before you can comment on or make changes to this bug.
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