[f-spot/rubenv-gsoc-2009: 34/86] Fix straight exporting of RAW files.



commit fb35a2cdca297ff610823d8827a939e99cecc24d
Author: Ruben Vermeersch <ruben savanne be>
Date:   Wed Jul 29 15:25:01 2009 +0200

    Fix straight exporting of RAW files.

 src/Filters/ResizeFilter.cs |   12 ++++++++++--
 1 files changed, 10 insertions(+), 2 deletions(-)
---
diff --git a/src/Filters/ResizeFilter.cs b/src/Filters/ResizeFilter.cs
index ccd3437..d39b0f7 100644
--- a/src/Filters/ResizeFilter.cs
+++ b/src/Filters/ResizeFilter.cs
@@ -69,8 +69,16 @@ namespace FSpot.Filters {
 						exif_data = new Exif.ExifData (source);
 						
 						FSpotPixbufUtils.SaveJpeg (scaled, dest, 95, exif_data);
-					} else 
-						throw new NotImplementedException (String.Format (Catalog.GetString ("No way to save files of type \"{0}\""), destination_extension));
+					} else {
+						// FIXME: Metadata is lost, we need decent metadata handling!
+						dest_uri = req.TempUri (".jpg");
+						dest = dest_uri.LocalPath;
+
+						byte [] image_data = PixbufUtils.Save (scaled, "jpeg", new string [] {"quality" }, new string [] { "95" });
+						using (Stream stream = System.IO.File.OpenWrite (dest)) {
+							stream.Write (image_data, 0, image_data.Length);
+						}
+					}
 				}
 			}
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]