All pastes #589679 Raw Edit

Unnamed

public text v1 · immutable
#589679 ·published 2007-06-26 03:49 UTC
rendered paste body
                public static string EncodeUserPhoto(Gdk.Pixbuf image, int size)
                {
                        try {
                                //Logger.Debug("Resizing photo");
                                image = image.ScaleSimple(size, size, Gdk.InterpType.Bilinear);
                                string encodedUserPhoto = System.Convert.ToBase64String(image.SaveToBuffer("jpeg"));
                                Logger.Debug("encodedPhotoString: " + encodedUserPhoto);
                                return encodedUserPhoto;
                        } catch (GLib.GException) {}

                        Logger.Debug ("Unable to load icon user photo.");
                        return null;

                }