[shotwell/wip/faster-import: 3/5] wip: don't uncessarily do a raw processing for thumbs
- From: Jens Georg <jensgeorg src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [shotwell/wip/faster-import: 3/5] wip: don't uncessarily do a raw processing for thumbs
- Date: Thu, 27 Oct 2016 09:24:22 +0000 (UTC)
commit 1d6db9b0d7ed75cec8dcc6690bf4cf540e29c2a1
Author: Jens Georg <mail jensge org>
Date: Sun Oct 9 18:26:00 2016 +0200
wip: don't uncessarily do a raw processing for thumbs
Try to use the embedded preview instead.
Signed-off-by: Jens Georg <mail jensge org>
src/photos/RawSupport.vala | 13 +++++++++++++
1 files changed, 13 insertions(+), 0 deletions(-)
---
diff --git a/src/photos/RawSupport.vala b/src/photos/RawSupport.vala
index 441b899..05f652c 100644
--- a/src/photos/RawSupport.vala
+++ b/src/photos/RawSupport.vala
@@ -240,6 +240,7 @@ public class RawReader : PhotoFileReader {
}
public override Gdk.Pixbuf scaled_read(Dimensions full, Dimensions scaled) throws Error {
+ // Try to get the embedded thumbnail first
double width_proportion = (double) scaled.width / (double) full.width;
double height_proportion = (double) scaled.height / (double) full.height;
bool half_size = width_proportion < 0.5 && height_proportion < 0.5;
@@ -249,6 +250,18 @@ public class RawReader : PhotoFileReader {
processor.output_params->user_flip = GRaw.Flip.NONE;
processor.open_file(get_filepath());
+ try {
+ if (this.get_role () == Role.THUMBNAIL) {
+ processor.unpack_thumb();
+ var image = processor.make_thumb_image ();
+ return resize_pixbuf (image.get_pixbuf_copy (),
+ scaled,
+ Gdk.InterpType.BILINEAR);
+ }
+ } catch (Error error) {
+ // Nothing to do, continue with raw developer
+ }
+
processor.unpack();
processor.process();
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]