summaryrefslogtreecommitdiff
path: root/src/photos/RawSupport.vala
diff options
context:
space:
mode:
authorJörg Frings-Fürst <debian@jff-webhosting.net>2017-03-22 06:40:44 +0100
committerJörg Frings-Fürst <debian@jff-webhosting.net>2017-03-22 06:40:44 +0100
commit8e1c5a834469d804d28ee8ab2cbe2da8e600a789 (patch)
treeb9771456583eaead893cfd8f02e680b58a3da970 /src/photos/RawSupport.vala
parent80a5f2d8b095e895a5424f90b2ce4684d94c1a32 (diff)
parent3253d99365813f2d2ffd05e10cbb8c11f53d746e (diff)
Merge tag 'upstream/0.26.0'
Upstream version 0.26.0
Diffstat (limited to 'src/photos/RawSupport.vala')
-rw-r--r--src/photos/RawSupport.vala13
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();