From ea485a658e7ae81ec77e5a890274b8ba878d38c7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jes=C3=BAs=20Espino?= Date: Fri, 26 May 2023 11:13:31 +0200 Subject: [PATCH] Allow to use VP8L+ICC in the same file without APLH chunk --- testdata/gopher-doc.with-alpha.lossless.webp | Bin 0 -> 4296 bytes testdata/gopher-doc.with-alpha.png | Bin 0 -> 6083 bytes webp/decode.go | 3 --- webp/decode_test.go | 1 + 4 files changed, 1 insertion(+), 3 deletions(-) create mode 100644 testdata/gopher-doc.with-alpha.lossless.webp create mode 100644 testdata/gopher-doc.with-alpha.png diff --git a/testdata/gopher-doc.with-alpha.lossless.webp b/testdata/gopher-doc.with-alpha.lossless.webp new file mode 100644 index 0000000000000000000000000000000000000000..fe5018d2764fb9a28864cb430739a0c42bc9ff64 GIT binary patch literal 4296 zcmaKvXE%S4YF1fygKqn98uL^lKx%!zLF5~3&a5GhI! zEjUPY5#=Q6A>w#P&U?M*`S3jNx~{d?Z~yQAz4lu7+8_2dzow_x#RP!0u9m5lsj>|X z06>=9(Ezvra7|m=v=ByGO=x?sCg|xA~iKO}hC;<;Z02*-4*(JbN z)6~@P%>AF+!32PuMaHDg=K9Z`|Ekivx&@F|1VNG=C>LMxpjR=FTFTMWODpsbxGJ(ozy7-c09! zb17?*!z5{1NkEx3p;U`>Uy(Igm}$y=B6q{xUfy-eh+pY@$s72*o79HE5gcVN8)F+` zszn#Nm=ezOSj=)Y1EC=Bqca)3lH~u22*=+qcAC0i%rScZOVk1Xc}*P@*nfZ|@Y1WsOwSOnpze`DUuexiIfin3$o6Dl;Vl0+B)=Xt`Fj%wIQYt~RZ`@rZ87 zkovhY1X6Oe4hpwFmd&M6dULQAr^WMeNU5veB#GpN#;`q8-=2t;o*~Vw6|(a1rT0BA z$Mg&{{*+Dh7=`Lk5_o z;?#F~{hn3BEFVJ^dB)3Z;V>@|xV&ywg-%_lkQZ^6O~fK;YkI$GY>5gs(AWD_)~P4% zk;UWb*}Yl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