Beispiel #1
0
        public bool Convert(FilterRequest req)
        {
            Uri source = req.Current;

            using (ImageFile img = ImageFile.Create(source)) {
                Pixbuf  pixbuf  = img.Load();
                Profile profile = img.GetProfile();

                Adjustment adjustment = CreateAdjustment(pixbuf, profile);
                Gdk.Pixbuf final      = adjustment.Adjust();

                Uri dest_uri = req.TempUri(Path.GetExtension(source.LocalPath));
                using (Stream output = File.OpenWrite(dest_uri.LocalPath)) {
                    img.Save(final, output);
                }
                final.Dispose();
                req.Current = dest_uri;

                return(true);
            }
        }