diff --git a/.gitignore b/.gitignore
index 9dae5ec..09b8d0f 100644
--- a/.gitignore
+++ b/.gitignore
@@ -331,3 +331,4 @@ ASALocalRun/
# MFractors (Xamarin productivity tool) working folder
.mfractor/
Image Converter/Code/Github.cs
+Image Converter/gif2webp.exe
diff --git a/Image Converter/Code/Converter.cs b/Image Converter/Code/Converter.cs
index d53782c..bca6ecc 100644
--- a/Image Converter/Code/Converter.cs
+++ b/Image Converter/Code/Converter.cs
@@ -1,5 +1,6 @@
using System;
using System.Collections.Generic;
+using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Text;
@@ -45,12 +46,27 @@ private static void WebPConvert() {
magickImage.Settings.SetDefine(WEBP, "-quality", $"{Properties.Settings.Default.WebP_Quality}");
magickImage.Format = WEBP;
magickImage.Write($"{image}.webp");
-
- RemoveImage($"{info.FileName}{info.FileType}", info.FileLocation);
}
else if (info.FileType != ".webp") {
- //Todo: add gif conversion
+ Process gifProcess = new Process() {
+ StartInfo = {
+ FileName = "cmd.exe",
+ RedirectStandardInput = true,
+ RedirectStandardOutput = true,
+ CreateNoWindow = true,
+ UseShellExecute = false
+ }
+ };
+
+ gifProcess.Start();
+ gifProcess.StandardInput.WriteLine($"cd {Environment.CurrentDirectory}");
+ //process.StandardInput.WriteLine($"gif2webp.exe {Options.GetWebPQuality()} \"{Image}\" -o \"{infos.FileDirectory()}\\{infos.FileNameWithoutExtension()}.webp\"");
+ gifProcess.StandardInput.WriteLine($"gif2webp.exe {Properties.Settings.Default.WebP_Quality} \"{imageExt}\" -o \"{image}.webp\"");
+ gifProcess.StandardInput.Flush();
+ gifProcess.StandardInput.Close();
+ gifProcess.WaitForExit();
}
+ RemoveImage($"{info.FileName}{info.FileType}", info.FileLocation);
}
catch (Exception ex) {
Logger.Instance.LogError(ex);
@@ -63,7 +79,7 @@ private static void JpegConvert() {
string imageExt = $"{info.FileLocation}\\{info.FileName}{info.FileType}";
string image = $"{info.FileLocation}\\{info.FileName}";
- try{
+ try {
if (info.FileType != ".jpg" && info.FileType != ".jpeg" && info.FileType != ".gif") {
MagickImage magickImage = new MagickImage(imageExt);
magickImage.Settings.SetDefine(JPEG, "-quality", $"{Properties.Settings.Default.Jpeg_Quality}");
diff --git a/Image Converter/Code/Utilities.cs b/Image Converter/Code/Utilities.cs
index 75670dd..873845c 100644
--- a/Image Converter/Code/Utilities.cs
+++ b/Image Converter/Code/Utilities.cs
@@ -1,4 +1,5 @@
-using MaterialDesignThemes.Wpf;
+using MahApps.Metro.Controls;
+using MaterialDesignThemes.Wpf;
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
@@ -17,6 +18,7 @@ public class Utilities {
static readonly string[] SizeSuffixes = { "bytes", "KB", "MB", "GB", "TB", "PB", "EB", "ZB", "YB" };
public static SnackbarMessageQueue messageQueue { get; set; }
+ public static Flyout flyout { get; set; }
public static string SizeSuffix(long value, int decimalPlaces = 1) {
if (value < 0) {
@@ -64,7 +66,7 @@ public static void PopulateList(string[] droppedFiles) {
"“Begin with the end in mind.” – Steven Covey",
"“Much of the stress that people feel doesn’t come from having too much to do. It comes from not finishing what they started.” – David Allen",
"“It’s not enough to be busy, so are the ants. The question is, what are we busy about?” – Henry David Thoreau",
- "“You’ve got to think about big things while you’re doing small things, so that all the small things go in the right direction.” – Alvin Toffler"
+ "“You’ve got to think about big things while you’re doing small things, so that all the small things go in the right direction.” – Alvin Toffler",
"“In the long run, we shape our lives, and we shape ourselves. The process never ends until we die. And the choices we make are ultimately our own responsibility.” ― Eleanor Roosevelt"
};
diff --git a/Image Converter/Image Converter.csproj b/Image Converter/Image Converter.csproj
index 3ed51b0..8d63229 100644
--- a/Image Converter/Image Converter.csproj
+++ b/Image Converter/Image Converter.csproj
@@ -52,6 +52,9 @@
4
preview
+
+ icon.ico
+
..\packages\ControlzEx.3.0.2.4\lib\net462\ControlzEx.dll
@@ -62,9 +65,6 @@
..\packages\MahApps.Metro.1.6.5\lib\net47\MahApps.Metro.dll
-
- ..\packages\Markdig.0.16.0\lib\net40\Markdig.dll
-
..\packages\MaterialDesignColors.1.1.3\lib\net45\MaterialDesignColors.dll
@@ -80,9 +80,6 @@
..\packages\Microsoft-WindowsAPICodePack-Shell.1.1.3.3\lib\net452\Microsoft.WindowsAPICodePack.Shell.dll
-
- ..\packages\Neo.Markdig.Xaml.1.0.5\lib\net47\Neo.Markdig.Xaml.dll
-
..\packages\NLog.4.6.2\lib\net45\NLog.dll
@@ -179,20 +176,15 @@
Settings.settings
True
-
PublicResXFileCodeGenerator
Resources.Designer.cs
-
SettingsSingleFileGenerator
Settings.Designer.cs
-
- PreserveNewest
-
@@ -208,6 +200,12 @@
PreserveNewest
+
+ PreserveNewest
+
+
+ PreserveNewest
+
\ No newline at end of file
diff --git a/Image Converter/MainWindow.xaml b/Image Converter/MainWindow.xaml
index 3563709..1e29d01 100644
--- a/Image Converter/MainWindow.xaml
+++ b/Image Converter/MainWindow.xaml
@@ -25,14 +25,14 @@
-
-
@@ -41,9 +41,9 @@
-
-
-
+
+
+
@@ -79,7 +79,7 @@
-
+
diff --git a/Image Converter/MainWindow.xaml.cs b/Image Converter/MainWindow.xaml.cs
index 11d446b..243b344 100644
--- a/Image Converter/MainWindow.xaml.cs
+++ b/Image Converter/MainWindow.xaml.cs
@@ -30,11 +30,12 @@ public MainWindow() {
InitializeComponent();
Utilities.ImageListView = ImageList;
Utilities.messageQueue = SnackbarToaster.MessageQueue;
+ Utilities.flyout = FlyoutControl;
}
private void SettingsButton_Click(object sender, RoutedEventArgs e) => OpenFlyout(new SettingsContent(), Properties.Resources.Settings);
private void AboutButton_Click(object sender, RoutedEventArgs e) => OpenFlyout(new AboutContent(), Properties.Resources.About);
- private void BugButton_Click(object sender, RoutedEventArgs e) => OpenFlyout(new BugContent(), "Bugs or Features");
+ private void BugButton_Click(object sender, RoutedEventArgs e) => OpenFlyout(new BugContent(), Properties.Resources.BugsOrFeatures);
private void OpenFlyout(UserControl content, string header) {
content.Width = FlyoutWidth;
diff --git a/Image Converter/Properties/AssemblyInfo.cs b/Image Converter/Properties/AssemblyInfo.cs
index 07802d8..c18863e 100644
--- a/Image Converter/Properties/AssemblyInfo.cs
+++ b/Image Converter/Properties/AssemblyInfo.cs
@@ -8,11 +8,11 @@
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("Image Converter")]
-[assembly: AssemblyDescription("")]
+[assembly: AssemblyDescription("A simple and easy to use image converter")]
[assembly: AssemblyConfiguration("")]
-[assembly: AssemblyCompany("HP Inc.")]
+[assembly: AssemblyCompany("MrSquirrely.net")]
[assembly: AssemblyProduct("Image Converter")]
-[assembly: AssemblyCopyright("Copyright © HP Inc. 2019")]
+[assembly: AssemblyCopyright("Copyright © James 2019")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
diff --git a/Image Converter/Properties/Resources.Designer.cs b/Image Converter/Properties/Resources.Designer.cs
index 00eadd8..f34a8db 100644
--- a/Image Converter/Properties/Resources.Designer.cs
+++ b/Image Converter/Properties/Resources.Designer.cs
@@ -69,6 +69,78 @@ public static string About {
}
}
+ ///
+ /// Looks up a localized string similar to About the program.
+ ///
+ public static string AboutTooltip {
+ get {
+ return ResourceManager.GetString("AboutTooltip", resourceCulture);
+ }
+ }
+
+ ///
+ /// Looks up a localized string similar to Backup.
+ ///
+ public static string Backup {
+ get {
+ return ResourceManager.GetString("Backup", resourceCulture);
+ }
+ }
+
+ ///
+ /// Looks up a localized string similar to Browse.
+ ///
+ public static string Browse {
+ get {
+ return ResourceManager.GetString("Browse", resourceCulture);
+ }
+ }
+
+ ///
+ /// Looks up a localized string similar to Bug.
+ ///
+ public static string Bug {
+ get {
+ return ResourceManager.GetString("Bug", resourceCulture);
+ }
+ }
+
+ ///
+ /// Looks up a localized string similar to Bug or Feature.
+ ///
+ public static string BugContent {
+ get {
+ return ResourceManager.GetString("BugContent", resourceCulture);
+ }
+ }
+
+ ///
+ /// Looks up a localized string similar to Bugs or Features.
+ ///
+ public static string BugsOrFeatures {
+ get {
+ return ResourceManager.GetString("BugsOrFeatures", resourceCulture);
+ }
+ }
+
+ ///
+ /// Looks up a localized string similar to Report a Bug or request a feature.
+ ///
+ public static string BugsTooltip {
+ get {
+ return ResourceManager.GetString("BugsTooltip", resourceCulture);
+ }
+ }
+
+ ///
+ /// Looks up a localized string similar to Title:.
+ ///
+ public static string BugTitle {
+ get {
+ return ResourceManager.GetString("BugTitle", resourceCulture);
+ }
+ }
+
///
/// Looks up a localized string similar to Convert.
///
@@ -78,6 +150,24 @@ public static string Convert {
}
}
+ ///
+ /// Looks up a localized string similar to Start the conversion.
+ ///
+ public static string ConvertTooltip {
+ get {
+ return ResourceManager.GetString("ConvertTooltip", resourceCulture);
+ }
+ }
+
+ ///
+ /// Looks up a localized string similar to Emulate Size Of Jpeg.
+ ///
+ public static string EmulateJpeg {
+ get {
+ return ResourceManager.GetString("EmulateJpeg", resourceCulture);
+ }
+ }
+
///
/// Looks up a localized string similar to Exit.
///
@@ -87,6 +177,24 @@ public static string ExitMenu {
}
}
+ ///
+ /// Looks up a localized string similar to Exit the application.
+ ///
+ public static string ExitTooltip {
+ get {
+ return ResourceManager.GetString("ExitTooltip", resourceCulture);
+ }
+ }
+
+ ///
+ /// Looks up a localized string similar to Feature.
+ ///
+ public static string Feature {
+ get {
+ return ResourceManager.GetString("Feature", resourceCulture);
+ }
+ }
+
///
/// Looks up a localized string similar to File.
///
@@ -141,6 +249,15 @@ public static string FileType {
}
}
+ ///
+ /// Looks up a localized string similar to Finished with conversion.
+ ///
+ public static string FinishedConversion {
+ get {
+ return ResourceManager.GetString("FinishedConversion", resourceCulture);
+ }
+ }
+
///
/// Looks up a localized string similar to Image Converter.
///
@@ -150,6 +267,15 @@ public static string ImageConverter {
}
}
+ ///
+ /// Looks up a localized string similar to Lossless.
+ ///
+ public static string Lossless {
+ get {
+ return ResourceManager.GetString("Lossless", resourceCulture);
+ }
+ }
+
///
/// Looks up a localized string similar to Open File.
///
@@ -159,6 +285,15 @@ public static string OpenFileMenu {
}
}
+ ///
+ /// Looks up a localized string similar to Select and image or images to use.
+ ///
+ public static string OpenFileTooltip {
+ get {
+ return ResourceManager.GetString("OpenFileTooltip", resourceCulture);
+ }
+ }
+
///
/// Looks up a localized string similar to Open Folder.
///
@@ -168,6 +303,78 @@ public static string OpenFolderMenu {
}
}
+ ///
+ /// Looks up a localized string similar to Open a folder.
+ ///
+ public static string OpenFolderTooltip {
+ get {
+ return ResourceManager.GetString("OpenFolderTooltip", resourceCulture);
+ }
+ }
+
+ ///
+ /// Looks up a localized string similar to Play Sound When Finished.
+ ///
+ public static string PlaySound {
+ get {
+ return ResourceManager.GetString("PlaySound", resourceCulture);
+ }
+ }
+
+ ///
+ /// Looks up a localized string similar to Quality:.
+ ///
+ public static string Quality {
+ get {
+ return ResourceManager.GetString("Quality", resourceCulture);
+ }
+ }
+
+ ///
+ /// Looks up a localized string similar to Remove Alpha.
+ ///
+ public static string RemoveAlpha {
+ get {
+ return ResourceManager.GetString("RemoveAlpha", resourceCulture);
+ }
+ }
+
+ ///
+ /// Looks up a localized string similar to Reset.
+ ///
+ public static string Reset {
+ get {
+ return ResourceManager.GetString("Reset", resourceCulture);
+ }
+ }
+
+ ///
+ /// Looks up a localized string similar to Reset the settings to default settings.
+ ///
+ public static string ResetTooltip {
+ get {
+ return ResourceManager.GetString("ResetTooltip", resourceCulture);
+ }
+ }
+
+ ///
+ /// Looks up a localized string similar to Save.
+ ///
+ public static string Save {
+ get {
+ return ResourceManager.GetString("Save", resourceCulture);
+ }
+ }
+
+ ///
+ /// Looks up a localized string similar to Save the settings.
+ ///
+ public static string SaveTooltip {
+ get {
+ return ResourceManager.GetString("SaveTooltip", resourceCulture);
+ }
+ }
+
///
/// Looks up a localized string similar to Settings.
///
@@ -176,5 +383,41 @@ public static string Settings {
return ResourceManager.GetString("Settings", resourceCulture);
}
}
+
+ ///
+ /// Looks up a localized string similar to Opens the settings.
+ ///
+ public static string SettingsTooltip {
+ get {
+ return ResourceManager.GetString("SettingsTooltip", resourceCulture);
+ }
+ }
+
+ ///
+ /// Looks up a localized string similar to Submit.
+ ///
+ public static string SubmitBug {
+ get {
+ return ResourceManager.GetString("SubmitBug", resourceCulture);
+ }
+ }
+
+ ///
+ /// Looks up a localized string similar to Submit the bug or feature request.
+ ///
+ public static string SubmitTooltip {
+ get {
+ return ResourceManager.GetString("SubmitTooltip", resourceCulture);
+ }
+ }
+
+ ///
+ /// Looks up a localized string similar to Use A Custom Folder.
+ ///
+ public static string UseCustomFolder {
+ get {
+ return ResourceManager.GetString("UseCustomFolder", resourceCulture);
+ }
+ }
}
}
diff --git a/Image Converter/Properties/Resources.resx b/Image Converter/Properties/Resources.resx
index 4f2d02f..90e06a7 100644
--- a/Image Converter/Properties/Resources.resx
+++ b/Image Converter/Properties/Resources.resx
@@ -116,11 +116,9 @@
File
- menu file name
Image Converter
- Title name
File Name
@@ -143,9 +141,6 @@
Settings
-
- Open Folder
-
Open File
@@ -155,4 +150,88 @@
About
+
+ Open Folder
+
+
+ Bugs or Features
+
+
+ Submit
+
+
+ Title:
+
+
+ Bug
+
+
+ Bug or Feature
+
+
+ Feature
+
+
+ Backup
+
+
+ Use A Custom Folder
+
+
+ Play Sound When Finished
+
+
+ Browse
+
+
+ Emulate Size Of Jpeg
+
+
+ Lossless
+
+
+ Remove Alpha
+
+
+ Quality:
+
+
+ Reset
+
+
+ Save
+
+
+ Finished with conversion
+
+
+ Open a folder
+
+
+ Select and image or images to use
+
+
+ Exit the application
+
+
+ Report a Bug or request a feature
+
+
+ Opens the settings
+
+
+ About the program
+
+
+ Start the conversion
+
+
+ Submit the bug or feature request
+
+
+ Reset the settings to default settings
+
+
+ Save the settings
+
\ No newline at end of file
diff --git a/Image Converter/Todo.cs b/Image Converter/Todo.cs
index b1afc04..e9dec3b 100644
--- a/Image Converter/Todo.cs
+++ b/Image Converter/Todo.cs
@@ -2,7 +2,6 @@
namespace Image_Converter {
public class Todo {
- //Todo: Add all localization including tool-tips
//Todo: Add WebP GIF Conversion
//! In the DotNet 4.8 update you can use Windows UWP controls, so I want to see if you can use the file dialog control from there instead of using Windows API Code Pack
diff --git a/Image Converter/Views/AboutContent.xaml b/Image Converter/Views/AboutContent.xaml
index dd246ea..d0b9b5d 100644
--- a/Image Converter/Views/AboutContent.xaml
+++ b/Image Converter/Views/AboutContent.xaml
@@ -8,6 +8,10 @@
mc:Ignorable="d"
Width="390" Height="580">
-
+
+
+
+
+
diff --git a/Image Converter/Views/AboutContent.xaml.cs b/Image Converter/Views/AboutContent.xaml.cs
index ff785c8..679266d 100644
--- a/Image Converter/Views/AboutContent.xaml.cs
+++ b/Image Converter/Views/AboutContent.xaml.cs
@@ -1,6 +1,6 @@
-using Markdig;
-using Neo.Markdig.Xaml;
+using System.Diagnostics;
using System.IO;
+using System.Media;
using System.Windows.Controls;
using System.Windows.Documents;
@@ -11,10 +11,13 @@ namespace Image_Converter.Views {
public partial class AboutContent : UserControl {
public AboutContent() {
InitializeComponent();
+ }
- string content = File.ReadAllText("README.md");
- FlowDocument doc = MarkdownXaml.ToFlowDocument(content, new MarkdownPipelineBuilder().UseXamlSupportedExtensions().Build());
- AboutViewer.Document = doc;
+ private void FinishedSoundButton_Click(object sender, System.Windows.RoutedEventArgs e) {
+ SoundPlayer player = new SoundPlayer("finished.wav");
+ player.Play();
}
+
+ private void KennyLinkButton_Click(object sender, System.Windows.RoutedEventArgs e) => Process.Start("https://www.kenney.nl/");
}
}
diff --git a/Image Converter/Views/BugContent.xaml b/Image Converter/Views/BugContent.xaml
index ed8e27e..4db05ae 100644
--- a/Image Converter/Views/BugContent.xaml
+++ b/Image Converter/Views/BugContent.xaml
@@ -4,6 +4,7 @@
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:Image_Converter.Views"
+ xmlns:loc="clr-namespace:Image_Converter.Properties"
xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
mc:Ignorable="d"
Width="390" Height="580">
@@ -11,37 +12,29 @@
-
- Why no possible timetable?
-
+ FontSize="30" TextWrapping="Wrap" FontWeight="Bold"/>
- Please make sure you copied the correct content and is using Google Chrome
-
+ TextWrapping="Wrap"/>
- Right
-
+ Click="DialogButton_Click"/>
-
-
+
+
+
-
+
@@ -49,10 +42,10 @@
-
+
-
-
+
+
diff --git a/Image Converter/Views/BugContent.xaml.cs b/Image Converter/Views/BugContent.xaml.cs
index 9abdbd9..5f40ce4 100644
--- a/Image Converter/Views/BugContent.xaml.cs
+++ b/Image Converter/Views/BugContent.xaml.cs
@@ -24,7 +24,7 @@ private async void SubmitButton_Click(object sender, RoutedEventArgs e) {
Credentials credentials = new Credentials(Github.token);
client.Credentials = credentials;
- NewIssue createIssue = new NewIssue(TitleContent.Text) { Body = BodyContent.Text };
+ NewIssue createIssue = new NewIssue(TitleContent.Text) { Body = $"{BodyContent.Text}\n\n-Submitted in the Image Converter application" };
ComboBoxItem selectedItem = (ComboBoxItem)IssueTypeBox.SelectedItem;
switch (selectedItem.Content) {
case "Bug":
@@ -40,6 +40,7 @@ private async void SubmitButton_Click(object sender, RoutedEventArgs e) {
}else if (TitleContent.Text == "Example Bug Title") {
ShowError("You must change the body content.");
}
+ Utilities.flyout.IsOpen = false;
}
private void ShowError(string message) {
diff --git a/Image Converter/Views/SettingsContent.xaml b/Image Converter/Views/SettingsContent.xaml
index 6ec9770..fccd0a1 100644
--- a/Image Converter/Views/SettingsContent.xaml
+++ b/Image Converter/Views/SettingsContent.xaml
@@ -4,6 +4,7 @@
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:Image_Converter.Views"
+ xmlns:loc="clr-namespace:Image_Converter.Properties"
xmlns:mah="http://metro.mahapps.com/winfx/xaml/controls"
x:Class="Image_Converter.Views.SettingsContent"
mc:Ignorable="d" Width="390" Height="580">
@@ -11,38 +12,38 @@
-
-
-
-
-
+
+
+
+
+
-
-
-
-
-
+
+
+
+
+
-
+
-
-
-
-
+
+
+
+
-
-
+
+
diff --git a/Image Converter/Views/SettingsContent.xaml.cs b/Image Converter/Views/SettingsContent.xaml.cs
index bdaeb91..05861d5 100644
--- a/Image Converter/Views/SettingsContent.xaml.cs
+++ b/Image Converter/Views/SettingsContent.xaml.cs
@@ -1,4 +1,5 @@
-using Microsoft.WindowsAPICodePack.Dialogs;
+using Image_Converter.Code;
+using Microsoft.WindowsAPICodePack.Dialogs;
using System;
using System.Windows;
using System.Windows.Controls;
@@ -57,6 +58,8 @@ private void SaveButton_Click(object sender, RoutedEventArgs e) {
Properties.Settings.Default.Png_Quality = (int)PngQuality.Value;
//! Save the settings
Properties.Settings.Default.Save();
+
+ Utilities.flyout.IsOpen = false;
}
private void ResetButton_Click(object sender, RoutedEventArgs e) {
diff --git a/Image Converter/icon.ico b/Image Converter/icon.ico
new file mode 100644
index 0000000..1dec31b
Binary files /dev/null and b/Image Converter/icon.ico differ
diff --git a/Image Converter/packages.config b/Image Converter/packages.config
index e1ee7ab..b05ea4c 100644
--- a/Image Converter/packages.config
+++ b/Image Converter/packages.config
@@ -3,13 +3,11 @@
-
-
\ No newline at end of file