Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not supported FourCC: A.L.P.H. #2

Open
sonyi opened this issue Jan 17, 2019 · 7 comments
Open

Not supported FourCC: A.L.P.H. #2

sonyi opened this issue Jan 17, 2019 · 7 comments

Comments

@sonyi
Copy link

sonyi commented Jan 17, 2019

Not supported FourCC: A.L.P.H.
How to deal with it

@didi789
Copy link

didi789 commented May 22, 2019

Same here

@EstebanFuentealba
Copy link

Hello @b4rtaz, Thank you for your work. Any update for alpha channel

@paktech1
Copy link

Not supported FourCC: I.C.C.P.

@LionisIAm
Copy link

LionisIAm commented Sep 28, 2021

In case someone still need it:

  1. Add one more if branch at WebpContainerReader:
  if (isFourCc(fcc, 'I', 'C', 'C', 'P'))
                return readIccp();
  1. 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.

@KishorJena
Copy link

In case someone still need it:

  1. Add one more if branch at WebpContainerReader:
  if (isFourCc(fcc, 'I', 'C', 'C', 'P'))
                return readIccp();
  1. 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?

@KishorJena
Copy link

KishorJena commented Mar 26, 2022

Ok using smae code of ICCP for ALPH solved the isseu.
Thanks to LionisIAm.

PS: but transparent files throws error

@KishorJena
Copy link

KishorJena commented Dec 31, 2022

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;
	}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants