Skip to content
This repository has been archived by the owner on Aug 1, 2023. It is now read-only.

Commit

Permalink
V1.0 (#13)
Browse files Browse the repository at this point in the history
* Readme update

I made it look better, removed spelling mistakes(maybe) and added bages!

* Updated to add missing liraries

I'm gonna make him an offer he can't refuse.

* V0.6

Cleaned a lot of the code,
Changed how some things worked,
removed tabs and added WebM.

* Readme Update

* Version 1

This is the final update for the V1.0 release. I cleaned up more code. Changed the Message box from the material to the mahapps one.
  • Loading branch information
MrSquirrely authored Dec 10, 2017
1 parent 92eecc1 commit d18ca96
Show file tree
Hide file tree
Showing 14 changed files with 164 additions and 168 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
cwebp.exe
dwebp.exe
gif2webp.exe
ffmpeg.exe

# User-specific files
*.suo
Expand Down
2 changes: 0 additions & 2 deletions App.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,6 @@
<ResourceDictionary Source="pack://application:,,,/MahApps.Metro;component/Styles/Fonts.xaml" />
<ResourceDictionary Source="pack://application:,,,/MahApps.Metro;component/Styles/Colors.xaml" />
<ResourceDictionary Source="pack://application:,,,/MahApps.Metro;component/Styles/Accents/BaseLight.xaml" />
<!--<ResourceDictionary Source="pack://application:,,,/MahApps.Metro;component/Styles/Controls.AnimatedTabControl.xaml" />-->
<!--I might not use this... I'm working on something!-->

<!-- Material Design -->
<ResourceDictionary Source="pack://application:,,,/MaterialDesignThemes.Wpf;component/Themes/MaterialDesignTheme.Light.xaml" />
Expand Down
27 changes: 7 additions & 20 deletions Convert.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ public static void WebPEncode() {
Utils.FileLocation = Path.GetDirectoryName(file);

if (Utils.FileType == ".gif") {
var image = new WebP
WebP image = new WebP
{
WebPImage = file,
WebPOutput = Options.SetCustomOutput
Expand All @@ -29,7 +29,7 @@ public static void WebPEncode() {
File.Delete(file);
}
else if(Types.WebPTypes.Contains(Utils.FileType) && Utils.FileType != ".gif"){
var image = new WebP
WebP image = new WebP
{
WebPImage = file,
WebPQuality = Options.WebPQuality,
Expand All @@ -45,32 +45,19 @@ public static void WebPEncode() {
File.Delete(file);
}
else if (Types.WebMTypes.Contains(Utils.FileType)) {
var inputFile = new MediaFile { Filename = file};
var outputFile = new MediaFile {
Filename = Options.SetCustomOutput
WebM video = new WebM {
WebMInput = file,
WebMOutput = Options.SetCustomOutput
? $"{Options.OutDir}/{Utils.FileName}.webm"
: $"{Utils.FileLocation}/{Utils.FileName}.webm"
};

var engine = new Engine();
engine.Convert(inputFile, outputFile);
video.Encode();
File.Delete(file);
}
}
}
catch (Exception e) {
Console.WriteLine(e.Message);
}
}

private static async void WebMEncodeAsync(string file) {
//string outPut = Options.SetCustomOutput
// ? $"{Options.OutDir}/{Utils.FileName}.webm"
// : $"{Utils.FileLocation}/{Utils.FileName}.webm";
//IConversion conversion = new Conversion();
//bool conversionResult = await conversion.SetInput(file).SetOutput(outPut).Start();
}
#endregion
#endregion

}
}
5 changes: 5 additions & 0 deletions Enums.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,11 @@ class nFile {
public string Location { get; set; }
}

enum Message {
DirectoryExists,
AlreadyFilesLoaded,
WebM
}
class Types {
/// <summary>
/// A list of supported image containers. I'm not sure if this is all of them, but this is all I could find.
Expand Down
1 change: 0 additions & 1 deletion FodyWeavers.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
<Costura CreateTemporaryAssemblies='true'/>
<Costura>
<IncludeAssemblies>
BespokeFusion
MahApps.Metro
MahApps.Metro.IconPacks
MaterialDesignColors
Expand Down
9 changes: 6 additions & 3 deletions MainWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
using System.Diagnostics;
using System.Windows.Input;
using System.Collections.Specialized;
using MahApps.Metro.Controls.Dialogs;

namespace SquirrelyConverter {
/// <summary>
Expand All @@ -33,20 +34,22 @@ public partial class MainWindow {

public MainWindow() {
InitializeComponent();
Utils.Main = this;
Utils.encodeItems = EncodeItems;
((INotifyCollectionChanged)EncodeItems.Items).CollectionChanged += EncodeItems_DataContextChanged;
Options.FirstRun();
var left = Mouse.LeftButton;
}

private void ItemsDropped(object sender, DragEventArgs e) => Utils.ItemsDropped(EncodeItems, e.Data.GetData(DataFormats.FileDrop) as string[]);
private void ItemsDropped(object sender, DragEventArgs e) => Utils.ItemsDroppedAsync(e.Data.GetData(DataFormats.FileDrop) as string[]);
private void MoveWindow_MouseDown(object sender, MouseButtonEventArgs e) { if (e.ChangedButton == MouseButton.Left) DragMove(); }
private void EncodeItems_DataContextChanged(object sender, NotifyCollectionChangedEventArgs e) => ItemsLoadedLabel.Content = $"Items Loaded: {EncodeItems.Items.Count}";
private void ClearButton_Click(object sender, RoutedEventArgs e) => EncodeItems.Items.Clear();
private void MetroWindow_Closed(object sender, EventArgs e) => Utils.DisposeToast();
private void SettingsButton_Click(object sender, RoutedEventArgs e) => Utils.OpenSettings();
private void MetroWindow_KeyDown(object sender, KeyEventArgs e) => Utils.ClearItems(EncodeItems.SelectedIndex, EncodeItems, e);
private void MetroWindow_KeyDown(object sender, KeyEventArgs e) => Utils.ClearItems(EncodeItems.SelectedIndex, e);
private void ReportBug_OnClick(object sender, RoutedEventArgs e) => Process.Start("https://github.com/MrSquirrely/SquirrelyConverter/issues/new");
private void EncodeButton_Click(object sender, RoutedEventArgs e) => Utils.StartEncode();
private void EncodeButton_Click(object sender, RoutedEventArgs e) => Utils.StartEncodeAsync();

}

Expand Down
13 changes: 8 additions & 5 deletions Properties/Resources.resx
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Serialization.Formatters.Binary.BinaryFormatter
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
Expand All @@ -60,6 +60,7 @@
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
Expand All @@ -68,9 +69,10 @@
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" />
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
Expand All @@ -85,9 +87,10 @@
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" msdata:Ordinal="1" />
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
Expand All @@ -109,9 +112,9 @@
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>
29 changes: 17 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# Squirrely Converter [![GitHub (pre-)release](https://img.shields.io/github/release/MrSquirrelyNet/SquirrelyConverter/all.svg?style=for-the-badge)](https://github.com/MrSquirrelyNet/SquirrelyConverter/releases)
[source]: https://cdn3.iconfinder.com/data/icons/lexter-flat-colorfull-file-formats/56/webp-32.png

###### A simple converter for WebP and WebM
### Currently there is minimal support for WebM. It is coming.
Expand All @@ -9,31 +10,35 @@ A Simple and **Hopefully,** easy to use a converter for the WebP and WebM contai
> [**WebP**](https://en.wikipedia.org/wiki/WebP) is an image format employing both lossy and lossless compression.<br>
> [**WebM**](https://en.wikipedia.org/wiki/WebM) is a media file format. It is primarily intended to offer a royalty-free alternative to use in the HTML5 video and the HTML5 audio tags.
## Things I know I am changing/adding
## What is coming?
- Allowing you to change the colors of the program.
- Different message box, the current one is buggy.
- Better looking Settings page
- Possible WeBM Settings

## Change Log
V1:
- Changed the message box to a better looking one.
- Using FFMpeg
V0.6:
- Removed Encoding all together
- Added WebM Support
- Moved all code into the Utils class
- Changed Icon


## Libraries Used

- [Costura Fody](https://www.nuget.org/packages/Costura.Fody/)
- [Dragablz](https://www.nuget.org/packages/Dragablz/)
- [Notifications Wpf |My Edit|](https://github.com/MrSquirrelyNet/Notifications.Wpf)
- [Notifications Wpf |Original|](https://github.com/Federerer/Notifications.Wpf)
- [Notifications Wpf (My Edit)](https://github.com/MrSquirrelyNet/Notifications.Wpf)
- [Notifications Wpf (Original)](https://github.com/Federerer/Notifications.Wpf)
- [MahApps Metro](https://www.nuget.org/packages/MahApps.Metro/1.5.0)
- [MahApps Metro IconPacks](https://www.nuget.org/packages/MahApps.Metro.IconPacks/)
- [Material Design in XAML](https://www.nuget.org/packages/MaterialDesignThemes/)
- [Material Design in XAML MahApps](https://www.nuget.org/packages/MaterialDesignThemes.MahApps/)
- [Material Message Box](https://www.nuget.org/packages/MaterialMessageBox/)
- [Media Toolkit](https://www.nuget.org/packages/MediaToolkit/)
- [Microsoft WindowsAPICodePack Shell](https://www.nuget.org/packages/Microsoft.WindowsAPICodePack-Shell/)

## Change Log
V0.6:
- Removed Decoding all together
- Added WebM Support
- Moved all code into the Utils class
- Changed Icon


The Icon was generated by [Android Asset Studio](https://romannurik.github.io/AndroidAssetStudio/index.html)

Expand Down
6 changes: 0 additions & 6 deletions SettingsWindow.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,17 +33,11 @@
<Grid Background="#FFE5E5E5">
<CheckBox x:Name="NoAlpha" Content="No Alpha" HorizontalAlignment="Left" Margin="10,10,0,0" VerticalAlignment="Top"/>
<CheckBox x:Name="SaveEXIF" Content="Save Metadata" HorizontalAlignment="Left" Margin="10,33,0,0" VerticalAlignment="Top"/>
<Label Content="More to come!" HorizontalAlignment="Left" Margin="10,179,0,0" VerticalAlignment="Top"/>
<Slider x:Name="Quality" HorizontalAlignment="Left" Margin="10,85,0,0" VerticalAlignment="Top" Width="466" Maximum="100" SmallChange="1" Value="80"/>
<Label Content="WebPQuality (Default 80)" HorizontalAlignment="Left" Margin="10,56,0,0" VerticalAlignment="Top"/>
<CheckBox x:Name="Lossless" Content="WebPLossless" HorizontalAlignment="Left" Margin="87,10,0,0" VerticalAlignment="Top"/>
</Grid>
</TabItem>
<TabItem Header="WebM">
<Grid Background="#FFE5E5E5">
<Label Content="Coming Soon!" HorizontalAlignment="Left" Margin="10,10,0,0" VerticalAlignment="Top"/>
</Grid>
</TabItem>
</TabControl>
<Button x:Name="SaveButton" Content="Save" HorizontalAlignment="Left" Margin="407,327,0,0" VerticalAlignment="Top" Width="75" Click="SaveButton_Click"/>
<Button x:Name="CancelButton" Content="Cancel" HorizontalAlignment="Left" Margin="327,327,0,0" VerticalAlignment="Top" Width="75" Click="CancelButton_Click"/>
Expand Down
14 changes: 7 additions & 7 deletions SquirrelyConverter.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,6 @@
<ApplicationIcon>icon.ico</ApplicationIcon>
</PropertyGroup>
<ItemGroup>
<Reference Include="BespokeFusion, Version=1.0.1.10, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\MaterialMessageBox.1.0.0.11\lib\BespokeFusion.dll</HintPath>
</Reference>
<Reference Include="Costura, Version=1.6.2.0, Culture=neutral, PublicKeyToken=9919ef960d84173d, processorArchitecture=MSIL">
<HintPath>..\packages\Costura.Fody.1.6.2\lib\dotnet\Costura.dll</HintPath>
<Private>False</Private>
Expand Down Expand Up @@ -124,6 +121,7 @@
</Compile>
<Compile Include="Enums.cs" />
<Compile Include="Utils.cs" />
<Compile Include="WebM.cs" />
<Compile Include="WebP.cs" />
<Page Include="MainWindow.xaml">
<Generator>MSBuild:Compile</Generator>
Expand Down Expand Up @@ -186,19 +184,21 @@
</ItemGroup>
<ItemGroup>
<Content Include="cwebp.exe">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="dwebp.exe">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<None Include="FodyWeavers.xml">
<SubType>Designer</SubType>
</None>
<Content Include="ffmpeg.exe">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="gif2webp.exe">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
</ItemGroup>
<ItemGroup />
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
<PropertyGroup>
Expand Down
Loading

0 comments on commit d18ca96

Please sign in to comment.