Open Source Web Application Framework for ASP.NET Core
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

34 lines
834 B

using System;
using System.IO;
namespace Volo.Abp.Imaging;
public static class ImageFileHelper
{
public static Stream GetJpgTestFileStream()
{
return GetTestFileStream("abp.jpg");
}
public static Stream GetPngTestFileStream()
{
return GetTestFileStream("abp.png");
}
public static Stream GetWebpTestFileStream()
{
return GetTestFileStream("abp.webp");
}
private static Stream GetTestFileStream(string fileName)
{
var assembly = typeof(ImageFileHelper).Assembly;
var resourceStream = assembly.GetManifestResourceStream("Volo.Abp.Imaging.Files." + fileName);
if (resourceStream == null)
{
throw new Exception($"File {fileName} does not exists!");
}
return resourceStream;
}
}