Wrap image size check in using block #304

This commit is contained in:
Malte Rosenbjerg 2022-03-24 20:24:22 +01:00
parent 4e977c6647
commit 05839825e0

View file

@ -247,7 +247,10 @@ public static bool Convert(
public static bool PosterWithAudio(string image, string audio, string output) public static bool PosterWithAudio(string image, string audio, string output)
{ {
FFMpegHelper.ExtensionExceptionCheck(output, FileExtension.Mp4); FFMpegHelper.ExtensionExceptionCheck(output, FileExtension.Mp4);
FFMpegHelper.ConversionSizeExceptionCheck(Image.FromFile(image)); using (var imageFile = Image.FromFile(image))
{
FFMpegHelper.ConversionSizeExceptionCheck(imageFile);
}
return FFMpegArguments return FFMpegArguments
.FromFileInput(image, false, options => options .FromFileInput(image, false, options => options