Skip to content

Commit

Permalink
Update for Gdk.Pixbuf binding changes in the latest GtkSharp
Browse files Browse the repository at this point in the history
SaveToStream and SavetoStreamv are now properly implemented, so the jpeg quality setting now works again

Related to #234
Fixes: #1959642, #1993035
  • Loading branch information
cameronwhite committed Oct 16, 2022
1 parent cb29809 commit e973699
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 5 deletions.
3 changes: 1 addition & 2 deletions Pinta.Core/ImageFormats/GdkPixbufFormat.cs
Expand Up @@ -102,8 +102,7 @@ protected virtual void DoSave (Pixbuf pb, GLib.IFile file, string fileType, Gtk.
{
using var stream = file.Replace ();
try {
// TODO-GTK4: the simpler SaveToStream() seems to be missing in GtkSharp.
pb.SaveToStreamv (stream, fileType, null, null, null);
pb.SaveToStream (stream, fileType, null);
} finally {
stream.Close (null);
}
Expand Down
4 changes: 1 addition & 3 deletions Pinta.Core/ImageFormats/JpegFormat.cs
Expand Up @@ -66,9 +66,7 @@ protected override void DoSave (Pixbuf pb, GLib.IFile file, string fileType, Gtk

using var stream = file.Replace ();
try {
// FIXME - SaveToStreamv() isn't wrapped correctly by GtkSharp, so the quality setting is skipped for now...
pb.SaveToStreamv (stream, fileType, null, null, null);
//pb.SavevUtf8 (fileName, fileType, new string?[] { "quality", null }, new string?[] { level.ToString (), null });
pb.SaveToStreamv (stream, fileType, new string?[] { "quality", null }, new string?[] { level.ToString (), null }, null);
} finally {
stream.Close (null);
}
Expand Down

0 comments on commit e973699

Please sign in to comment.