-
-
Notifications
You must be signed in to change notification settings - Fork 852
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
JPEG/WebP/... part of the executable even if all I do is save a PNG #2486
Comments
Wrong native.zip above. Use this one: |
Thanks for raising this. This is something I definitely want to get fixed ASAP. |
don't you just need to set |
actually looks like thats not currently possible, but i would have to think adding a setter to |
ok looks like we should be able to introduce an MSBuild 'Feature switch' to toggle on the default behaviour of Well based on my quick read of the Customizing Trimming in .NET 5 blog post anyway. |
I believe it would require adding a new
|
Feature switches are last resort option - they introduce differences in behavior, require explicit opt in, and are a general pain. From just looking at the above root graph - would a SaveAsPng overload that requires non-null configuration work? |
I think looking at using overloads and not falling back to |
Prerequisites
DEBUG
andRELEASE
modeImageSharp version
3.0.1
Other ImageSharp packages and versions
?
Environment (Operating system, version and so on)
Windows 11
.NET Framework version
?
Description
As requested on Twitter: https://twitter.com/James_M_South/status/1673489691956625410
When compiling https://github.com/pjmlp/ppm2png/tree/2b77cfc103f48bbcdce0512f6182153d6d4d8644/csharp with PublishAot, the produced executable is rather large. The reason why it's large can be inspected with Sizoscope. I made this change to the above repo in an attempt to make the size smaller but it didn't help much:
I'm attaching intermediate files that can be opened with Sizoscope:
native.zip but feel free to make your own.
One immediate issue is that this app also includes support for WebP/JPEG/etc. even though I don't need it.
Sizoscope root cause analysis for
WebpEncoder..ctor
points toConfiguration.Default
accessed from here:There might be more issues.
Steps to Reproduce
Clone the repo and build the project. Add switches described in the sizoscope repo if you want to inspect with sizoscope.
Images
No response
The text was updated successfully, but these errors were encountered: