[chronojump] Encoder image save: ensure end on .png
- From: Xavier de Blas <xaviblas src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [chronojump] Encoder image save: ensure end on .png
- Date: Mon, 15 Apr 2013 11:50:58 +0000 (UTC)
commit 1aee77dc4bcd28376d860b3ffc241f34564b8812
Author: Xavier de Blas <xaviblas gmail com>
Date: Mon Apr 15 13:50:30 2013 +0200
Encoder image save: ensure end on .png
src/gui/encoder.cs | 2 ++
src/util.cs | 10 ++++++++--
2 files changed, 10 insertions(+), 2 deletions(-)
---
diff --git a/src/gui/encoder.cs b/src/gui/encoder.cs
index 70d9200..0a150d2 100644
--- a/src/gui/encoder.cs
+++ b/src/gui/encoder.cs
@@ -1000,6 +1000,8 @@ public partial class ChronoJumpWindow
if(checkFileOp == Constants.EncoderCheckFileOp.ANALYZE_EXPORT_ALL_CURVES ||
checkFileOp == Constants.EncoderCheckFileOp.ANALYZE_SAVE_TABLE)
exportFileName = Util.AddCsvIfNeeded(exportFileName);
+ else
+ exportFileName = Util.AddPngIfNeeded(exportFileName);
try {
if (File.Exists(exportFileName)) {
Log.WriteLine(string.Format(
diff --git a/src/util.cs b/src/util.cs
index 916ff92..c60ddeb 100644
--- a/src/util.cs
+++ b/src/util.cs
@@ -1564,11 +1564,17 @@ public class Util
return array;
}
- public static string AddCsvIfNeeded(string myFile)
+ public static string AddCsvIfNeeded(string myFile) {
+ return addExtensionIfNeeded(myFile, ".csv");
+ }
+ public static string AddPngIfNeeded(string myFile) {
+ return addExtensionIfNeeded(myFile, ".png");
+ }
+ private static string addExtensionIfNeeded(string myFile, string extension)
{
int posOfDot = myFile.LastIndexOf('.');
if (posOfDot == -1)
- myFile += ".csv";
+ myFile += extension;
return myFile;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]