Update ImageReader to reaad images without resizinf

This commit is contained in:
TheXamlGuy
2024-10-10 15:47:01 +01:00
parent 1e402960f3
commit b1e239ab04
6 changed files with 38 additions and 24 deletions
+15 -3
View File
@@ -7,11 +7,23 @@ public class ImageReader(IImageResizer imageResizer) :
IImageReader
{
public IImageDescriptor Get(Stream stream,
int width,
int height,
double width,
double height,
bool maintainAspectRatio)
{
Bitmap resizedImage = imageResizer.Resize(stream, width, height, maintainAspectRatio);
Bitmap resizedImage = imageResizer.Resize(stream,
width,
height,
maintainAspectRatio);
return new ImageDescriptor(resizedImage, width, height);
}
public IImageDescriptor Get(Stream stream)
{
Bitmap image = new(stream);
return new ImageDescriptor(image,
image.Size.Width,
image.Size.Height);
}
}