@Override
    public Dimension getImageSize(final ByteSource byteSource, final PcxImagingParameters params) throws ImagingException, IOException {
        final PcxHeader pcxHeader = readPcxHeader(byteSource);
        final int xSize = pcxHeader.xMax - pcxHeader.xMin + 1;
        if (xSize < 0) {
            throw new ImagingException("Image width is negative");
        }
        final int ySize = pcxHeader.yMax - pcxHeader.yMin + 1;
        if (ySize < 0) {
            throw new ImagingException("Image height is negative");
        }
        return new Dimension(xSize, ySize);
    }
Constructs a new instance with the little-endian byte order.
src/main/java/org/apache/commons/imaging/formats/pcx/PcxImageParser.java