Files
glycin/source-files/glycin-loaders-recognize-new-mime-type-for-dds.patch
T

57 lines
2.1 KiB
Diff

From 476720131410e80436e65b9e24fcab52467e1b0f Mon Sep 17 00:00:00 2001
From: Xi Ruoyao <[email protected]>
Date: Thu, 2 Jul 2026 00:45:54 +0800
Subject: [PATCH] glycin-loaders: recognize the new mime type for dds
In shared-mime-info-2.5, the mime type for dds is image/vnd.ms-dds
instead of image/x-dds.
Link: https://gitlab.freedesktop.org/xdg/shared-mime-info/-/commit/124ce8abbfd6
Part-of: <https://gitlab.gnome.org/GNOME/glycin/-/merge_requests/429>
---
glycin-loaders/glycin-image-rs/glycin-image-rs.conf | 5 +++++
glycin-loaders/glycin-image-rs/src/main.rs | 2 +-
news.d/2.1.6/added-support-for-new-dds-mime-type | 1 +
3 files changed, 7 insertions(+), 1 deletion(-)
create mode 100644 news.d/2.1.6/added-support-for-new-dds-mime-type
diff --git a/glycin-loaders/glycin-image-rs/glycin-image-rs.conf b/glycin-loaders/glycin-image-rs/glycin-image-rs.conf
index 7e744ea2..284426a6 100644
--- a/glycin-loaders/glycin-image-rs/glycin-image-rs.conf
+++ b/glycin-loaders/glycin-image-rs/glycin-image-rs.conf
@@ -51,6 +51,11 @@ Exec = @EXEC@
Exec = @EXEC@
Creator = true
+[loader:image/vnd.ms-dds]
+Exec = @EXEC@
+Identifiers=0:DDS;
+Extension=dds
+
[loader:image/x-dds]
Exec = @EXEC@
diff --git a/glycin-loaders/glycin-image-rs/src/main.rs b/glycin-loaders/glycin-image-rs/src/main.rs
index 43e82eb2..22f46400 100644
--- a/glycin-loaders/glycin-image-rs/src/main.rs
+++ b/glycin-loaders/glycin-image-rs/src/main.rs
@@ -289,7 +289,7 @@ impl ImageRsFormat<Reader> {
))
.format_name("BMP")
.default_bit_depth(8),
- "image/x-dds" => Self::new(ImageRsDecoder::Dds(
+ "image/x-dds" | "image/vnd.ms-dds" => Self::new(ImageRsDecoder::Dds(
codecs::dds::DdsDecoder::new(data).expected_error()?,
))
.format_name("DDS")
diff --git a/news.d/2.1.6/added-support-for-new-dds-mime-type b/news.d/2.1.6/added-support-for-new-dds-mime-type
new file mode 100644
index 00000000..afa0d890
--- /dev/null
+++ b/news.d/2.1.6/added-support-for-new-dds-mime-type
@@ -0,0 +1 @@
+Recognize image/vnd.ms-dds as DDS that is used starting with shared-mime-info 2.5.
--
GitLab