@Override
    public int compareTo(@NonNull Size other) {
        int aPixels = this.height * this.width;
        int bPixels = other.height * other.width;
        if (bPixels < aPixels) {
            return 1;
        }
        if (bPixels > aPixels) {
            return -1;
        }
        return 0;
    }
Default sort order is ascending by size.
zxing-android-embedded/src/com/journeyapps/barcodescanner/Size.java