diff options
author | Jörg Frings-Fürst <debian@jff.email> | 2023-06-14 20:36:17 +0200 |
---|---|---|
committer | Jörg Frings-Fürst <debian@jff.email> | 2023-06-14 20:36:17 +0200 |
commit | 31804433d72460cbe0a39f9f8ea5e76058d84cda (patch) | |
tree | 2084a84c39f159c6aea254775dc0880d52579d45 /src/photos/RawSupport.vala | |
parent | a9898fb3f39c44a85876930ef6b2558052569ae6 (diff) | |
parent | d443a3c2509889533ca812c163056bace396b586 (diff) |
Update upstream source from tag 'upstream/0.32.1'
Update to upstream version '0.32.1'
with Debian dir c460ad6e13d3c39eaa2d5399059385e64e6fba4c
Diffstat (limited to 'src/photos/RawSupport.vala')
-rw-r--r-- | src/photos/RawSupport.vala | 19 |
1 files changed, 12 insertions, 7 deletions
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 { |