We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 89f54c5 commit 28a7343Copy full SHA for 28a7343
SynoAI/Controllers/ImageController.cs
@@ -0,0 +1,22 @@
1
+using Microsoft.AspNetCore.Mvc;
2
+using System.IO;
3
+
4
+namespace SynoAI.Controllers
5
+{
6
+ public class ImageController : Controller
7
+ {
8
+ /// <summary>
9
+ /// Return snapshot image as JPEG, either in original size or a scaled down version, if asked.
10
+ //// In order to use System.Drawing.Common
11
+ //// In Terminal, issue: dotnet add SynoAI package System.Drawing.Common
12
+ /// </summary>
13
+ [Route("Image/{cameraName}/{filename}")]
14
+ public ActionResult Get(string cameraName, string filename)
15
16
+ // Get and return the original Snapshot
17
+ string path = Path.Combine(Constants.DIRECTORY_CAPTURES, cameraName, filename);
18
+ byte[] originalSnapshot = System.IO.File.ReadAllBytes(path);
19
+ return File(originalSnapshot, "image/jpeg");
20
+ }
21
22
+}
0 commit comments