summaryrefslogtreecommitdiff
path: root/src/photos/RawSupport.vala
diff options
context:
space:
mode:
authorJörg Frings-Fürst <debian@jff.email>2023-06-14 20:36:37 +0200
committerJörg Frings-Fürst <debian@jff.email>2023-06-14 20:36:37 +0200
commitbb80d3feebdc9acc52e3f4ad24084d8425f043a2 (patch)
tree2084a84c39f159c6aea254775dc0880d52579d45 /src/photos/RawSupport.vala
parentb26ff0798252a1a8072dd2c7a67f6205de9fde11 (diff)
parent31804433d72460cbe0a39f9f8ea5e76058d84cda (diff)
Merge branch 'feature/upstream' into develop
Diffstat (limited to 'src/photos/RawSupport.vala')
-rw-r--r--src/photos/RawSupport.vala19
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 {