mirror of
https://github.com/Tichau/FileConverter.git
synced 2026-11-23 11:02:33 +01:00
Add webp output type
This commit is contained in:
1 parent
83d85cb93c
commit
dc54a7eae0
7 files changed
+27
-1
No files matched your search
@@ -189,6 +189,10 @@ namespace FileConverter.ConversionJobs
|
||||
case OutputType.Pdf:
|
||||
break;
|
||||
|
||||
case OutputType.Webp:
|
||||
image.Quality = this.ConversionPreset.GetSettingsValue<int>(ConversionPreset.ConversionSettingKeys.ImageQuality);
|
||||
break;
|
||||
|
||||
default:
|
||||
this.ConversionFailed(string.Format(Properties.Resources.ErrorUnsupportedOutputFormat, this.ConversionPreset.OutputType));
|
||||
image.Progress -= this.Image_Progress;
|
||||
|
||||
@@ -508,6 +508,14 @@ namespace FileConverter
|
||||
this.InitializeSettingsValue(ConversionPreset.ConversionSettingKeys.ImageMaximumSize, "0");
|
||||
break;
|
||||
|
||||
case OutputType.Webp:
|
||||
this.InitializeSettingsValue(ConversionPreset.ConversionSettingKeys.ImageQuality, "40");
|
||||
this.InitializeSettingsValue(ConversionPreset.ConversionSettingKeys.ImageScale, "1");
|
||||
this.InitializeSettingsValue(ConversionPreset.ConversionSettingKeys.ImageRotation, "0");
|
||||
this.InitializeSettingsValue(ConversionPreset.ConversionSettingKeys.ImageClampSizePowerOf2, "False");
|
||||
this.InitializeSettingsValue(ConversionPreset.ConversionSettingKeys.ImageMaximumSize, "0");
|
||||
break;
|
||||
|
||||
case OutputType.Ico:
|
||||
break;
|
||||
|
||||
|
||||
@@ -67,6 +67,7 @@ namespace FileConverter
|
||||
case "tiff":
|
||||
case "svg":
|
||||
case "xcf":
|
||||
case "webp":
|
||||
return InputCategoryNames.Image;
|
||||
|
||||
case "gif":
|
||||
@@ -115,6 +116,7 @@ namespace FileConverter
|
||||
case OutputType.Ico:
|
||||
case OutputType.Jpg:
|
||||
case OutputType.Png:
|
||||
case OutputType.Webp:
|
||||
return category == InputCategoryNames.Image || category == InputCategoryNames.Document;
|
||||
|
||||
case OutputType.Gif:
|
||||
|
||||
@@ -21,5 +21,6 @@ namespace FileConverter
|
||||
Png,
|
||||
Wav,
|
||||
Webm,
|
||||
Webp,
|
||||
}
|
||||
}
|
||||
@@ -91,6 +91,12 @@ namespace FileConverter.Windows
|
||||
set;
|
||||
}
|
||||
|
||||
public DataTemplate WebpSettingsDataTemplate
|
||||
{
|
||||
get;
|
||||
set;
|
||||
}
|
||||
|
||||
public override DataTemplate SelectTemplate(object item, DependencyObject container)
|
||||
{
|
||||
if (item == null)
|
||||
@@ -140,6 +146,9 @@ namespace FileConverter.Windows
|
||||
|
||||
case OutputType.Webm:
|
||||
return this.WebmSettingsDataTemplate;
|
||||
|
||||
case OutputType.Webp:
|
||||
return this.WebpSettingsDataTemplate;
|
||||
}
|
||||
|
||||
return this.DefaultDataTemplate;
|
||||
|
||||
@@ -710,7 +710,8 @@
|
||||
OgvSettingsDataTemplate="{StaticResource OgvSettingsDataTemplate}"
|
||||
PngSettingsDataTemplate="{StaticResource PngSettingsDataTemplate}"
|
||||
WavSettingsDataTemplate="{StaticResource WavSettingsDataTemplate}"
|
||||
WebmSettingsDataTemplate="{StaticResource WebmSettingsDataTemplate}" />
|
||||
WebmSettingsDataTemplate="{StaticResource WebmSettingsDataTemplate}"
|
||||
WebpSettingsDataTemplate="{StaticResource JpgSettingsDataTemplate}" />
|
||||
</Window.Resources>
|
||||
<Window.Title>
|
||||
<Binding Converter="{StaticResource ApplicationVersionToApplicationName}" Mode="OneWay" Path="(local:Application.ApplicationVersion)"/>
|
||||
|
||||
@@ -71,6 +71,7 @@ namespace FileConverter
|
||||
new OutputTypeViewModel(OutputType.Avi),
|
||||
new OutputTypeViewModel(OutputType.Png),
|
||||
new OutputTypeViewModel(OutputType.Jpg),
|
||||
new OutputTypeViewModel(OutputType.Webp),
|
||||
new OutputTypeViewModel(OutputType.Ico),
|
||||
new OutputTypeViewModel(OutputType.Gif),
|
||||
new OutputTypeViewModel(OutputType.Pdf),
|
||||
|
||||
Reference in new issue
Block a user