File webp-alpha-detection.patch of Package exiv2.30966

From ecaf1dd478ef7291f0263aa3be30d1a260cb9a4e Mon Sep 17 00:00:00 2001
From: skal <pascal.massimino@gmail.com>
Date: Thu, 22 Nov 2018 17:27:29 +0100
Subject: [PATCH] Fix alpha bit detection in VP8L chunks

As per the spec ([1]), the alpha_bit is located on the 4th byte of the payload, just after the height.

This seems to fix the bug reported on GIMP ([2]) where an incorrect file was generated.



[1] https://developers.google.com/speed/webp/docs/webp_lossless_bitstream_specification#2_riff_header
[2] https://gitlab.gnome.org/GNOME/gimp/issues/1818
---
 src/webpimage.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/webpimage.cpp b/src/webpimage.cpp
index dfecc80213..67aade4ac7 100644
--- a/src/webpimage.cpp
+++ b/src/webpimage.cpp
@@ -237,7 +237,7 @@ namespace Exiv2 {
 
             /* Chunk with with lossless image data. */
             if (equalsWebPTag(chunkId, WEBP_CHUNK_HEADER_VP8L) && !has_alpha) {
-                if ((payload.pData_[5] & WEBP_VP8X_ALPHA_BIT) == WEBP_VP8X_ALPHA_BIT) {
+                if ((payload.pData_[4] & WEBP_VP8X_ALPHA_BIT) == WEBP_VP8X_ALPHA_BIT) {
                     has_alpha = true;
                 }
             }
openSUSE Build Service is sponsored by