summaryrefslogtreecommitdiff
path: root/src/photos/RawSupport.vala
diff options
context:
space:
mode:
authorJörg Frings-Fürst <debian@jff.email>2023-06-28 21:35:52 +0200
committerJörg Frings-Fürst <debian@jff.email>2023-06-28 21:35:52 +0200
commitb86540b743f1a87a163ffb811c8fe22a01fefa38 (patch)
treeb47cb3bb83c2377234226fb3987ab3320a987dd9 /src/photos/RawSupport.vala
parentac6e0b731b9f0b2efd392e3309a5c07e2a66adad (diff)
parente905d8e16eec152d19797937f13ba3cf4b8f8aca (diff)
Merge branch 'release/debian/0.32.1-1'debian/0.32.1-1
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 {