android-webp-encoder
android-webp-encoder copied to clipboard
Not supported FourCC: A.L.P.H.
Not supported FourCC: A.L.P.H. How to deal with it
Same here
Hello @b4rtaz, Thank you for your work. Any update for alpha channel
Not supported FourCC: I.C.C.P.
In case someone still need it:
- Add one more if branch at WebpContainerReader:
if (isFourCc(fcc, 'I', 'C', 'C', 'P'))
return readIccp();
- Also implement this func:
private WebpChunk readIccp() throws IOException {
int chunkSize = readUInt32();
WebpChunk chunk = new WebpChunk(WebpChunkType.VP8);
chunk.isLossless = false;
readPayload(chunkSize);
chunk.payload = null;
debug(String.format("iccp: bytes = %d", chunkSize));
return chunk;
}
P.S. Maybe will send PR later.
In case someone still need it:
- Add one more if branch at WebpContainerReader:
if (isFourCc(fcc, 'I', 'C', 'C', 'P')) return readIccp();
- Also implement this func:
private WebpChunk readIccp() throws IOException { int chunkSize = readUInt32(); WebpChunk chunk = new WebpChunk(WebpChunkType.VP8); chunk.isLossless = false; readPayload(chunkSize); chunk.payload = null; debug(String.format("iccp: bytes = %d", chunkSize)); return chunk; }
P.S. Maybe will send PR later.
Thanks and write for ALPHA as well please?
Ok using smae code of ICCP for ALPH solved the isseu. Thanks to LionisIAm.
PS: but transparent files throws error
Ok using same code of ICCP for ALPH solved the isseu. Thanks to LionisIAm.
PS: but transparent files throws error
It handles the error but It won't preserve the transparency rather it will add solid black background.
public WebpChunk read() throws IOException {
byte[] fcc = new byte[4];
if (read(fcc, 4) > 0) {
...
//added
if (isFourCc(fcc, 'I', 'C', 'C', 'P'))
return readIccp();
if (isFourCc(fcc, 'A', 'L', 'P', 'H'))
return readAlph();
...
}
...
}
private WebpChunk readAlph() throws IOException {
int chunkSize = readUInt32();
WebpChunk chunk = new WebpChunk(WebpChunkType.ALPH);
readPayload(chunkSize);
return chunk;
}