-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
quality
parameter is ignored in Bitmap.Save
with .jpg
#12493
Comments
Looks like quality parameter is not passed here |
To be clear, check for file extension is not present here, it is always saved as PNG https://github.com/AvaloniaUI/Avalonia/blob/1896e8ad68dc0fdb6c1055d36a97b926e0a32f17/src/Skia/Avalonia.Skia/Helpers/ImageSavingHelper.cs#L57C51-L57C51 |
We kinda need to add some basic support for BitmapEncoder API |
I started working on support for image formats at least for saving. PR should be out in an hour or so. |
Hi, this issue is closed but the PR do not seem to allow to save as Jpeg. That would be really really really convinient if we can Save an Avalonia as Jpeg in addition to PNG, really. My typical use case: I am doing image manipulation using my own buffer, and then I need to display it, and to save it as Jpeg. So I have to:
|
You can use only |
Correct, there is this workaround, thanks for the remainder. I am also investigating to see if I can create a SKImage pointing to an existing memory buffer for the save operation. |
Describe the bug
The parameter does not appear to have any effect and no warning is reported.
To Reproduce
Steps to reproduce the behavior:
Bitmap
(I usedWriteableBitmap
) of ~1920x1080bitmap.Save("test.jpg", quality: 10)
(I also tried 1)Expected behavior
You get a low quality version of the bitmap weighting under 100KB
Actual behavior
You get a high quality file over 1MB in size.
It appears the resulting file is actually a PNG instead of JPEG.
Screenshots
N/A
Desktop (please complete the following information):
The text was updated successfully, but these errors were encountered: