From d443a3c2509889533ca812c163056bace396b586 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Frings-F=C3=BCrst?= Date: Wed, 14 Jun 2023 20:35:58 +0200 Subject: New upstream version 0.32.1 --- src/photos/RawSupport.vala | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) (limited to 'src/photos/RawSupport.vala') diff --git a/src/photos/RawSupport.vala b/src/photos/RawSupport.vala index 8c23826..538c949 100644 --- a/src/photos/RawSupport.vala +++ b/src/photos/RawSupport.vala @@ -51,7 +51,7 @@ public class RawFileFormatDriver : PhotoFileFormatDriver { public class RawFileFormatProperties : PhotoFileFormatProperties { private static string[] KNOWN_EXTENSIONS = { - "3fr", "arw", "srf", "sr2", "bay", "crw", "cr2", "cap", "iiq", "eip", "dcs", "dcr", "drf", + "3fr", "arw", "srf", "sr2", "bay", "crw", "cr2", "cr3", "cap", "iiq", "eip", "dcs", "dcr", "drf", "k25", "kdc", "dng", "erf", "fff", "mef", "mos", "mrw", "nef", "nrw", "orf", "ptx", "pef", "pxn", "r3d", "raf", "raw", "rw2", "raw", "rwl", "rwz", "x3f", "srw" }; @@ -63,6 +63,7 @@ public class RawFileFormatProperties : PhotoFileFormatProperties { /* manufacturer blessed MIME types */ "image/x-canon-cr2", + "image/x-canon-cr3", "image/x-canon-crw", "image/x-fuji-raf", "image/x-adobe-dng", @@ -85,6 +86,7 @@ public class RawFileFormatProperties : PhotoFileFormatProperties { "image/x-bay", "image/x-crw", "image/x-cr2", + "image/x-cr3", "image/x-cap", "image/x-iiq", "image/x-eip", @@ -174,7 +176,6 @@ public class RawSniffer : PhotoFileSniffer { try { processor.open_file(file.get_path()); - processor.unpack(); processor.adjust_sizes_info_only(); } catch (GRaw.Exception exception) { if (exception is GRaw.Exception.UNSUPPORTED_FILE) @@ -195,7 +196,7 @@ public class RawSniffer : PhotoFileSniffer { // ignored } - if (detected.metadata != null) { + if (calc_md5 && detected.metadata != null) { detected.exif_md5 = detected.metadata.exif_hash(); detected.thumbnail_md5 = detected.metadata.thumbnail_hash(); } @@ -211,15 +212,19 @@ public class RawSniffer : PhotoFileSniffer { } public class RawReader : PhotoFileReader { + private PhotoMetadata? cached_metadata = null; + public RawReader(string filepath) { base (filepath, PhotoFileFormat.RAW); } public override PhotoMetadata read_metadata() throws Error { - PhotoMetadata metadata = new PhotoMetadata(); - metadata.read_from_file(get_file()); - - return metadata; + if (cached_metadata == null) { + PhotoMetadata metadata = new PhotoMetadata(); + metadata.read_from_file(get_file()); + cached_metadata = metadata; + } + return cached_metadata; } public override Gdk.Pixbuf unscaled_read() throws Error { -- cgit v1.2.3