summaryrefslogtreecommitdiff
path: root/src/photos/WebPSupport.vala
diff options
context:
space:
mode:
authorJörg Frings-Fürst <debian@jff.email>2024-11-11 12:28:09 +0100
committerJörg Frings-Fürst <debian@jff.email>2024-11-11 12:28:09 +0100
commitcb001bb8056869f98e9a62248bdd509a69d08faf (patch)
treeec5e83ac39e4e5cec0ab9494da2d0edaafe72d89 /src/photos/WebPSupport.vala
parent1bbf886bafc680c56ddd5e27ddd803b4e03685df (diff)
parent5b7b3b1dfd5ce7c275881098310667b09562ad27 (diff)
Update upstream source from tag 'upstream/0.32.10'
Update to upstream version '0.32.10' with Debian dir 4a4ccaeec66d543745486a1cf408bbaa58c6e02f
Diffstat (limited to 'src/photos/WebPSupport.vala')
-rw-r--r--src/photos/WebPSupport.vala10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/photos/WebPSupport.vala b/src/photos/WebPSupport.vala
index b467b24..543c889 100644
--- a/src/photos/WebPSupport.vala
+++ b/src/photos/WebPSupport.vala
@@ -209,8 +209,18 @@ private class WebpReader : PhotoFileReader {
uint8[] buffer;
FileUtils.get_data(this.get_filepath(), out buffer);
+ var features = WebP.BitstreamFeatures();
+ WebP.GetFeatures(buffer, out features);
+
+ if (features.has_animation) {
+ throw new IOError.INVALID_DATA("Animated WebP files are not yet supported");
+ }
+
int width, height;
var pixdata = WebP.DecodeRGBA(buffer, out width, out height);
+ if (pixdata == null) {
+ throw new IOError.INVALID_DATA("Failed to decode WebP file");
+ }
pixdata.length = width * height * 4;
return new Gdk.Pixbuf.from_data(pixdata, Gdk.Colorspace.RGB, true, 8, width, height, width * 4);