mirror of https://github.com/ivanch/tcc.git
mudanças
This commit is contained in:
parent
150ec0e1d7
commit
2085b7d89b
|
@ -34,25 +34,13 @@ namespace TCC.Controllers
|
|||
[HttpGet("load-image")]
|
||||
public async Task<IActionResult> GetSimpleImage()
|
||||
{
|
||||
var result = ImageService.GetSimpleImage();
|
||||
|
||||
var imageStream = new MemoryStream();
|
||||
result.Write(imageStream);
|
||||
imageStream.Position = 0;
|
||||
|
||||
return File(imageStream, "image/png");
|
||||
return File(ImageService.GetSimpleImage(), "image/png");
|
||||
}
|
||||
|
||||
[HttpGet("load-big-image")]
|
||||
public async Task<IActionResult> GetBigImage()
|
||||
{
|
||||
var result = ImageService.GetBigImage();
|
||||
|
||||
var imageStream = new MemoryStream();
|
||||
result.Write(imageStream);
|
||||
imageStream.Position = 0;
|
||||
|
||||
return File(imageStream, "image/png");
|
||||
return File(ImageService.GetBigImage(), "image/png");
|
||||
}
|
||||
|
||||
[HttpPost("save-big-image")]
|
||||
|
|
|
@ -4,13 +4,13 @@ namespace tcc_app
|
|||
{
|
||||
public static class ImageHelper
|
||||
{
|
||||
public static MagickImage SimpleImage;
|
||||
public static MagickImage BigImage;
|
||||
public static byte[] SimpleImage;
|
||||
public static byte[] BigImage;
|
||||
|
||||
static ImageHelper()
|
||||
{
|
||||
SimpleImage = new MagickImage("simpleimage.png");
|
||||
BigImage = new MagickImage("bigimage.png");
|
||||
SimpleImage = File.ReadAllBytes("static/simpleimage.png");
|
||||
BigImage = File.ReadAllBytes("static/bigimage.png");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -19,7 +19,6 @@ namespace TCC
|
|||
options.Limits.MaxRequestBodySize = int.MaxValue; // if don't set default value is: 30 MB
|
||||
});
|
||||
|
||||
|
||||
var app = builder.Build();
|
||||
|
||||
app.UseStaticFiles(new StaticFileOptions
|
||||
|
|
|
@ -62,12 +62,12 @@ namespace TCC.Services
|
|||
file.Close();
|
||||
}
|
||||
|
||||
public MagickImage GetSimpleImage()
|
||||
public byte[] GetSimpleImage()
|
||||
{
|
||||
return ImageHelper.SimpleImage;
|
||||
}
|
||||
|
||||
public MagickImage GetBigImage()
|
||||
public byte[] GetBigImage()
|
||||
{
|
||||
return ImageHelper.BigImage;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue