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

Calculation of numberOfTilesX and numberOfTilesY subtracts xOsiz/yOsiz instead of xTOsiz/yTOsiz #221

Closed
bitsgalore opened this issue Nov 13, 2023 · 5 comments
Labels
bug A product defect that needs fixing
Milestone

Comments

@bitsgalore
Copy link
Member

bitsgalore commented Nov 13, 2023

As described here by @comstock and @aous72:

aous72/OpenJPH#113 (comment)

Some of the files (both JPH and codestream) fail validation with:

    <tests>
        <foundExpectedNumberOfTiles>False</foundExpectedNumberOfTiles>
        <foundExpectedNumberOfTileParts>False</foundExpectedNumberOfTileParts>
    </tests>

TODO: figure out whether this is a Jpylyzer bug or a real fault of the images.

@bitsgalore
Copy link
Member Author

Looks like a fault of the images, not Jpylyzer, see:

aous72/OpenJPH#113 (comment)

@aous72
Copy link

aous72 commented Nov 13, 2023

Hi Johan,

Thank you for looking into this -- it always useful to confirm against other peoples' code.
I apologize for not having the time to have a more detailed report when I first looked at it.

With that said, -- please correct me if I am wrong -- the image simple_enc_irv97_tall_narrow1.j2c has TWO tiles.
Please refer to equation B-5 of the standard. This also explains the tpsot and tnsot values.

Thank you.

Kind regards,
Aous.

@bitsgalore
Copy link
Member Author

I think you're right - looking at the code again:

# Number of tiles

Here I see:

        numberOfTilesX = math.ceil((xsiz - xOsiz) / xTsiz)
        numberOfTilesY = math.ceil((ysiz - yOsiz) / yTsiz)

But of course this should be:

          numberOfTilesX = math.ceil((xsiz - xTOsiz) / xTsiz)
          numberOfTilesY = math.ceil((ysiz - yTOsiz) / yTsiz)

Will correct this in the stable release.

Thanks again for reporting this, and apologies for any confusion caused by my initial response!

@bitsgalore bitsgalore changed the title OpenJPH test files result in tile and tile-part related validation errors Calculation of numberOfTilesX and numberOfTilesY subtracts xOsiz/yOsiz instead of xTOsiz/YTOsiz Nov 14, 2023
@bitsgalore bitsgalore changed the title Calculation of numberOfTilesX and numberOfTilesY subtracts xOsiz/yOsiz instead of xTOsiz/YTOsiz Calculation of numberOfTilesX and numberOfTilesY subtracts xOsiz/yOsiz instead of xTOsiz/yTOsiz Nov 14, 2023
@aous72
Copy link

aous72 commented Nov 14, 2023

Thank you Johan.

@bitsgalore bitsgalore added the bug A product defect that needs fixing label Nov 14, 2023
@bitsgalore
Copy link
Member Author

bitsgalore commented Dec 11, 2023

Fixed: 1d47452
Also added file that triggered this to test corpus + added test: fc1a2d0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug A product defect that needs fixing
Projects
None yet
Development

No branches or pull requests

2 participants