summaryrefslogtreecommitdiff
path: root/src/main.vala
diff options
context:
space:
mode:
authorJörg Frings-Fürst <debian@jff.email>2023-12-17 19:58:04 +0100
committerJörg Frings-Fürst <debian@jff.email>2023-12-17 19:58:04 +0100
commitf5a0cee8ccecc7b6c6c2d8e9fb6f6eecd53531fe (patch)
tree4fe410ce27a30bc752d350aa042dae8fd042d0a1 /src/main.vala
parent87ba373882f475f02a524a120b59ea9fcccf14e5 (diff)
New upstream version 0.32.4upstream/0.32.4
Diffstat (limited to 'src/main.vala')
-rw-r--r--src/main.vala63
1 files changed, 63 insertions, 0 deletions
diff --git a/src/main.vala b/src/main.vala
index 32e3d83..d07b7f5 100644
--- a/src/main.vala
+++ b/src/main.vala
@@ -205,6 +205,67 @@ void library_exec(string[] mounts) {
run_system_pictures_import();
}
+ bool heif = false;
+ bool jxl = false;
+ bool png = false;
+ bool tiff = false;
+ bool avif = false;
+ bool bmp = false;
+ bool gif = false;
+
+ var formats = Gdk.Pixbuf.get_formats();
+ foreach (var format in formats) {
+ if ("image/heif" in format.get_mime_types()) {
+ heif = true;
+ }
+ if ("image/jxl" in format.get_mime_types()) {
+ jxl = true;
+ }
+ if ("image/png" in format.get_mime_types()) {
+ png = true;
+ }
+ if ("image/tiff" in format.get_mime_types()) {
+ tiff = true;
+ }
+ if ("image/avif" in format.get_mime_types()) {
+ avif = true;
+ }
+ if ("image/bmp" in format.get_mime_types()) {
+ bmp = true;
+ }
+ if ("image/gif" in format.get_mime_types()) {
+ gif = true;
+ }
+ }
+
+ bool can_read_bmff = false;
+ Bytes b = null;
+ try {
+ b = GLib.resources_lookup_data("/org/gnome/Shotwell/misc/canary.avif", GLib.ResourceLookupFlags.NONE);
+ } catch (Error err) {
+ error("Failed to look up mandatory resource: %s", err.message);
+ }
+
+ try {
+ var m = new GExiv2.Metadata();
+ m.open_buf(b.get_data());
+ can_read_bmff = true;
+ } catch (Error err) {
+ // Do nothing
+ }
+
+ message("Supported codecs....");
+ message(" WEBP : yes, builtin");
+ message(" RAW : yes, builtin");
+ message(" CR3 : %s", can_read_bmff ? "yes" : "no");
+ message(" JPEG : yes, gdk-pixbuf");
+ message(" PNG : %s, gdk-pixbuf", png ? "yes" : "no");
+ message(" GIF : %s, gdk-pixbuf", gif ? "yes" : "no");
+ message(" TIFF : %s, gdk-pixbuf", tiff ? "yes" : "no");
+ message(" JPEG XL: %s, gdk-pixbuf, %s meta-data", jxl ? "yes" : "no", can_read_bmff ? "yes" : "no");
+ message(" AVIF : %s, gdk-pixbuf, %s meta-data", avif ? "yes" : "no", can_read_bmff ? "yes" : "no");
+ message(" HEIF : %s, gdk-pixbuf, %s meta-data", heif ? "yes" : "no", can_read_bmff ? "yes" : "no");
+
debug("%lf seconds to Gtk.main()", startup_timer.elapsed());
Application.get_instance().start();
@@ -405,6 +466,8 @@ void main(string[] args) {
return;
}
+ typeof(DismissableTextView).ensure();
+
if (CommandlineOptions.browse_profiles) {
var window = new Gtk.Dialog();
window.set_title (_("Choose Shotwell's profile"));