diff options
| author | Jörg Frings-Fürst <debian@jff.email> | 2026-03-09 18:19:48 +0100 |
|---|---|---|
| committer | Jörg Frings-Fürst <debian@jff.email> | 2026-03-09 18:19:48 +0100 |
| commit | b11befe1c9ea84969ebd418e96f7209b772b58d0 (patch) | |
| tree | 4cee94cb12ad4dd24253c2a111b87577f50ed80d /src/photos/AvifSupport.vala | |
| parent | d048b2c970f6182a2201b5ba6c29d0d155abc22b (diff) | |
| parent | 8656a544ddcf098e10df1430eecb75902dbc7999 (diff) | |
Merge branch 'release/debian/0.32.15-1'HEADdebian/0.32.15-1master
Diffstat (limited to 'src/photos/AvifSupport.vala')
| -rw-r--r-- | src/photos/AvifSupport.vala | 25 |
1 files changed, 20 insertions, 5 deletions
diff --git a/src/photos/AvifSupport.vala b/src/photos/AvifSupport.vala index 842f0fc..0df57a6 100644 --- a/src/photos/AvifSupport.vala +++ b/src/photos/AvifSupport.vala @@ -79,7 +79,7 @@ public class AvifWriter : PhotoFileWriter { } public override void write(Gdk.Pixbuf pixbuf, Jpeg.Quality quality) throws Error { - pixbuf.save(get_filepath(), "avif", "quality", "90", null); + pixbuf.save(get_filepath(), "avif", "quality", quality.get_pct_text(), null); } } @@ -89,7 +89,8 @@ public class AvifMetadataWriter : PhotoFileMetadataWriter { } public override void write_metadata(PhotoMetadata metadata) throws Error { - metadata.write_to_file(get_file()); + // TODO: Not yet implemented in gexiv2 + // metadata.write_to_file(get_file()); } } @@ -99,6 +100,19 @@ public class AvifFileFormatDriver : PhotoFileFormatDriver { public static void init() { instance = new AvifFileFormatDriver(); AvifFileFormatProperties.init(); + + var formats = Gdk.Pixbuf.get_formats(); + var seen = false; + can_write = true; + + foreach (var format in formats) { + if (format.get_name() == "avif") { + seen = true; + can_write = can_write && format.is_writable(); + } + } + + can_write = can_write && seen; } public static AvifFileFormatDriver get_instance() { @@ -112,13 +126,14 @@ public class AvifFileFormatDriver : PhotoFileFormatDriver { public override PhotoFileReader create_reader(string filepath) { return new AvifReader(filepath); } - + + static bool can_write; public override bool can_write_image() { - return true; + return AvifFileFormatDriver.can_write; } public override bool can_write_metadata() { - return true; + return false; } public override PhotoFileWriter? create_writer(string filepath) { |
