summaryrefslogtreecommitdiff
path: root/src/main.vala
diff options
context:
space:
mode:
authorJörg Frings-Fürst <debian@jff.email>2023-12-17 19:58:25 +0100
committerJörg Frings-Fürst <debian@jff.email>2023-12-17 19:58:25 +0100
commit4cb46f4de4b881e5b1f65af017dca6f3917e55e5 (patch)
treefb359e210d2d9c30f5ad36a447ea29b62ae9bb56 /src/main.vala
parent841f952294b349b2b8e2afb5305ce34a3b59bb4b (diff)
parentf5a0cee8ccecc7b6c6c2d8e9fb6f6eecd53531fe (diff)
Update upstream source from tag 'upstream/0.32.4'
Update to upstream version '0.32.4' with Debian dir 51798a6af1c9b7e48f979c020d72f3c5ddd964a6
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"));