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

V3 : Decode Chunky Tile Rows Directly. #2874

Merged
merged 12 commits into from
Feb 2, 2025

Conversation

JimBobSquarePants
Copy link
Member

Prerequisites

  • I have written a descriptive pull-request title
  • I have verified that there are no overlapping pull-requests open
  • I have verified that I am following the existing coding patterns and practice as demonstrated in the repository. These follow strict Stylecop rules 👮.
  • I have provided test coverage for my change (where applicable)

Description

Fixes #2873
Avoids the integer overflow issue by removing the interim allocation completely and decoding directly to the pixel buffer.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot reviewed 1 out of 1 changed files in this pull request and generated no comments.

Comments suppressed due to low confidence (1)

src/ImageSharp/Formats/Tiff/TiffDecoderCore.cs:611

  • Corrected spelling from 'Tiff's' to 'TIFFs'.
/// Decodes the image data for TIFFs which arrange the pixel data in tiles and the chunky configuration.
@stefannikolei
Copy link
Contributor

@JimBobSquarePants Look at #2855 i fixed the build there. And just checked it still works

@JimBobSquarePants
Copy link
Member Author

@JimBobSquarePants Look at #2855 I fixed the build there. And just checked it still works

Ah no, it's something else. I've already done that using the following which covers all cases.

if: ${{ contains(matrix.options.os, 'ubuntu') }}

What I'm seeing is a difference in behavior with dotnet build between old builds and now. The older SDKs are no longer installed on the image by default and after installing it seems to throw errors for stuff that did not throw before.

It's a proper head scratcher!

@stefannikolei
Copy link
Contributor

@JimBobSquarePants Look at #2855 I fixed the build there. And just checked it still works

Ah no, it's something else. I've already done that using the following which covers all cases.

if: ${{ contains(matrix.options.os, 'ubuntu') }}

What I'm seeing is a difference in behavior with dotnet build between old builds and now. The older SDKs are no longer installed on the image by default and after installing it seems to throw errors for stuff that did not throw before.

It's a proper head scratcher!

I saw that. But I just triggered a build in my branch and I got no build errors oO

@JimBobSquarePants
Copy link
Member Author

@JimBobSquarePants Look at #2855 I fixed the build there. And just checked it still works

Ah no, it's something else. I've already done that using the following which covers all cases.

if: ${{ contains(matrix.options.os, 'ubuntu') }}

What I'm seeing is a difference in behavior with dotnet build between old builds and now. The older SDKs are no longer installed on the image by default and after installing it seems to throw errors for stuff that did not throw before.
It's a proper head scratcher!

I saw that. But I just triggered a build in my branch and I got no build errors oO

I'm running a build against the legacy release/v3.1.x branch. That targets .NET 6 and 7. The main branch targets .NET 8 and 9 both of which are installed on the image.

@stefannikolei
Copy link
Contributor

stefannikolei commented Jan 30, 2025

I'm running a build against the legacy release/v3.1.x branch. That targets .NET 6 and 7. The main branch targets .NET 8 and 9 both of which are installed on the image.

Ah missed that one.. Was wondering why dotnet-setup was bumped.

Perhaps you can try to not go agains ubuntu-latest instead use ubuntu-22-04 (libgdi was installed on this one) or the version it worked the last time

@JimBobSquarePants
Copy link
Member Author

@stefannikolei it works if you install NET 8 and NET 6!! 🤷I'll just update the script to do that.

@stefannikolei
Copy link
Contributor

@stefannikolei it works if you install NET 8 and NET 6!! 🤷I'll just update the script to do that.

just checked which version of ubuntu was used
image

But when it works it works. Perhaps ubuntu-latest should not be used for the future. Instead use a explicit version, perhaps those issue won't come then.

@JimBobSquarePants
Copy link
Member Author

@stefannikolei it works if you install NET 8 and NET 6!! 🤷I'll just update the script to do that.

just checked which version of ubuntu was used image

But when it works it works. Perhaps ubuntu-latest should not be used for the future. Instead use a explicit version, perhaps those issue won't come then.

I would but they change old images also for some reason I don't understand.

actions/runner-images#11503

I think whatever issues there are have been fixed for .NET 8+ so going forward it hopefully should not be a problem.

Copy link
Collaborator

@brianpopow brianpopow left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good 👍

@aevitas
Copy link

aevitas commented Feb 1, 2025

Very much looking forward to these changes!

Curious, why are test runners using versions of .NET that are out of support, but not the most recent version? I could see the regressions argument, but arguably no one should be running EOL versions of .NET to begin with.

@brianpopow
Copy link
Collaborator

@aevitas while the image mentioned in Discussion 2870 can be decoded, it still suffers from the same issue mentioned in #2877. I am working on fixing that, too.

@JimBobSquarePants
Copy link
Member Author

@brianpopow do you want to use this branch?

If you can tell me where the issue manifests maybe I can have a look if you’re stuck?

@brianpopow
Copy link
Collaborator

@brianpopow do you want to use this branch?

@JimBobSquarePants I would suggest to first merge this branch into main and continue on a new branch, since it is a different issue.

If you can tell me where the issue manifests maybe I can have a look if you’re stuck?

I think, I know what needs to be done. The horizontal predictor is reversed by applying it to each row of the image, but for tiled images, it needs to be applied to each row of the tile.

@brianpopow brianpopow merged commit b8d1cd8 into release/3.1.x Feb 2, 2025
8 checks passed
@brianpopow brianpopow deleted the js/chunk-tiff-allocation branch February 2, 2025 18:20
@brianpopow
Copy link
Collaborator

brianpopow commented Feb 2, 2025

@JimBobSquarePants I think I made a mistake with merging this. I thought this was going into the main branch.

@JimBobSquarePants
Copy link
Member Author

@brianpopow All good. I wanted to target v3 since we are still a long way from a v4 launch. I'll open a second PR for v4.

JimBobSquarePants added a commit that referenced this pull request Feb 4, 2025
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

Successfully merging this pull request may close these issues.

4 participants