@Override
    public Dimension getImageSize(final ByteSource byteSource, final WebPImagingParameters params) throws ImagingException, IOException {
        try (ChunksReader reader = new ChunksReader(byteSource)) {
            final AbstractWebPChunk chunk = reader.readChunk();
            if (chunk instanceof WebPChunkVp8) {
                final WebPChunkVp8 vp8 = (WebPChunkVp8) chunk;
                return new Dimension(vp8.getWidth(), vp8.getHeight());
            }
            if (chunk instanceof WebPChunkVp8l) {
                final WebPChunkVp8l vp8l = (WebPChunkVp8l) chunk;
                return new Dimension(vp8l.getImageWidth(), vp8l.getImageHeight());
            }
            if (chunk instanceof WebPChunkVp8x) {
                final WebPChunkVp8x vp8x = (WebPChunkVp8x) chunk;
                return new Dimension(vp8x.getCanvasWidth(), vp8x.getCanvasHeight());
            }
            throw new ImagingException("Unknown WebP chunk type: " + chunk);
        }
    }
Constructs a new instance with the big-endian byte order.
src/main/java/org/apache/commons/imaging/formats/webp/WebPImageParser.java