aboutsummaryrefslogtreecommitdiff
path: root/Backend
diff options
context:
space:
mode:
Diffstat (limited to 'Backend')
-rw-r--r--Backend/Api/Api/Services/FileService.cs3
1 files changed, 3 insertions, 0 deletions
diff --git a/Backend/Api/Api/Services/FileService.cs b/Backend/Api/Api/Services/FileService.cs
index b951efc..440b24f 100644
--- a/Backend/Api/Api/Services/FileService.cs
+++ b/Backend/Api/Api/Services/FileService.cs
@@ -31,11 +31,14 @@ namespace Api.Services
Models.File f = await getById(id);
if (f == null || !System.IO.File.Exists(f.path))
return res;
+ if (System.IO.File.Exists(f.path + "-compress"))
+ return System.IO.File.ReadAllBytes(f.path + "-compress");
using (MagickImage image = new MagickImage(f.path))
{
image.Format = image.Format;
image.Quality = 30;
res= image.ToByteArray();
+ image.Write(f.path + "-compress");
}