mirror of
https://github.com/Tichau/FileConverter.git
synced 2026-11-20 09:32:54 +01:00
Implement gif to img conversion
This commit is contained in:
1 parent
03aeec001e
commit
ea22f9fb65
3 files changed
+10
-3
No files matched your search
@@ -43,8 +43,9 @@ namespace FileConverter.ConversionJobs
|
||||
return new ConversionJob_ImageMagick(conversionPreset, inputFilePath);
|
||||
}
|
||||
|
||||
if (Helpers.GetExtensionCategory(inputFileExtension) == Helpers.InputCategoryNames.Image ||
|
||||
Helpers.GetExtensionCategory(inputFileExtension) == Helpers.InputCategoryNames.Document)
|
||||
if (conversionPreset.OutputType == OutputType.Jpg ||
|
||||
conversionPreset.OutputType == OutputType.Png ||
|
||||
conversionPreset.OutputType == OutputType.Webp)
|
||||
{
|
||||
return new ConversionJob_ImageMagick(conversionPreset, inputFilePath);
|
||||
}
|
||||
|
||||
@@ -86,6 +86,12 @@ namespace FileConverter.ConversionJobs
|
||||
readSettings.Format = MagickFormat.Dng;
|
||||
break;
|
||||
|
||||
case ".gif":
|
||||
// Get the first frame of the gif for conversion.
|
||||
// Maybe in the future make this user selectable.
|
||||
readSettings.FrameIndex = 0;
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -216,7 +216,7 @@ namespace FileConverter
|
||||
case OutputType.Jpg:
|
||||
case OutputType.Png:
|
||||
case OutputType.Webp:
|
||||
return category == InputCategoryNames.Image || category == InputCategoryNames.Document;
|
||||
return category == InputCategoryNames.Image || category == InputCategoryNames.Document || category == InputCategoryNames.AnimatedImage;
|
||||
|
||||
case OutputType.Gif:
|
||||
return category == InputCategoryNames.Image || category == InputCategoryNames.Video || category == InputCategoryNames.AnimatedImage;
|
||||
|
||||
Reference in new issue
Block a user