Save() private static method

private static Save ( this pixbuf, string filename, string type, uint jpeg_quality ) : bool
pixbuf this
filename string
type string
jpeg_quality uint
return bool
    public static void Save(Gdk.Pixbuf pixbuf, System.IO.Stream stream, string type, string [] options, string [] values)
    {
        byte [] data;

        data = PixbufUtils.Save(pixbuf, type, options, values);
        stream.Write(data, 0, data.Length);
    }
示例#2
0
        public void SetThumbnail(Gdk.Pixbuf source)
        {
            // Then create the thumbnail
            // The DCF spec says thumbnails should be 160x120 always
            Gdk.Pixbuf thumbnail  = PixbufUtils.ScaleToAspect(source, 160, 120);
            byte []    thumb_data = PixbufUtils.Save(thumbnail, "jpeg", null, null);

            // System.Console.WriteLine ("saving thumbnail");

            // now update the exif data
            ExifData.Data = thumb_data;
        }
示例#3
0
        public override void Save(Gdk.Pixbuf pixbuf, System.IO.Stream stream)
        {
            // Console.WriteLine ("starting save");
            // First save the imagedata
            int quality = Header.GuessQuality();

            quality = quality == 0 ? 75 : quality;
            byte [] image_data            = PixbufUtils.Save(pixbuf, "jpeg", new string [] { "quality" }, new string [] { quality.ToString() });
            System.IO.MemoryStream buffer = new System.IO.MemoryStream();
            buffer.Write(image_data, 0, image_data.Length);
            buffer.Position = 0;

            // Console.WriteLine ("setting thumbnail");
            SetThumbnail(pixbuf);
            SetDimensions(pixbuf.Width, pixbuf.Height);
            pixbuf.Dispose();

            // Console.WriteLine ("saving metatdata");
            SaveMetaData(buffer, stream);
            // Console.WriteLine ("done");
            buffer.Close();
        }