Implement gif to img conversion

This commit is contained in:
RTnhN committed 2024-11-24 00:12:02 -06:00
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;
}
+1 -1
View File
@@ -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;