Thumbnail Generation
The BaseImageStorageService includes thumbnail generation for single images, used by the frontend to display camera previews without loading full-resolution images.
Algorithmβ
- Calculate the target dimensions while preserving the original aspect ratio
- Resize the image using
System.Drawing/ Emgu.CV - Encode as JPEG
- Save to Blob Storage alongside the full image
Aspect Ratio Preservationβ
The thumbnail maintains the source image's aspect ratio:
- If the source is landscape (wider than tall), the width is used as the constraint
- If the source is portrait (taller than wide), the height is used as the constraint
- The other dimension is calculated proportionally
Where Thumbnails Are Usedβ
- Frontend map β Camera pins show thumbnail previews on hover
- Camera list β Compact image previews in admin dashboard tables
- SignalR broadcasts β Thumbnail URLs are included in real-time metadata, allowing the frontend to display low-bandwidth previews instantly