Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions ImageMapper.slnx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
<File Path="AGENTS.md" />
<File Path="LICENSE" />
<File Path="README.md" />
<File Path="TODO.md" />
</Folder>
<Project Path="src/ImageMapper.Api/ImageMapper.Api.csproj" />
<Project Path="src/ImageMapper.AppHost/ImageMapper.AppHost.csproj" />
Expand Down
51 changes: 36 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,16 @@ ImageMapper is a server hosted application that processes images from a configur

This application is built using .NET and leverages the Leaflet.js library for map rendering. Aspire is used for hosting and orchestrating the application components, while MetadataExtractor is used to extract geotagged metadata from the images.

This project has partly been an experiment in using AI tools such as GitHub Copilot as a coding assistant, for initial scaffolding, and unit test creation.
This project has partly been an experiment in using AI tools such as GitHub Copilot as a coding assistant particularly for initial scaffolding and unit test creation.
With strict human review and modification to ensure quality and correctness with an exact idea of the design, using the tools to assist rather than replace human decision-making.

Also to use Aspire as a hosting and orchestration tool for a .NET application, to learn about its capabilities and features, and to demonstrate how it can be used in a real-world application.
Also to use Aspire as a hosting and orchestration tool for a .NET application, to learn about its capabilities and features.

The concepts here are not unique to .NET and could be implemented in any language or framework.

## Dependencies

- .NET 10 (likely will work with .NET 8+)
- .NET 10 (likely can be retargeted to work with .NET 8+)
- [Aspire](https://aspire.dev/)
- [MetadataExtractor](https://github.com/drewnoakes/metadata-extractor-dotnet)
- [Leaflet.js](https://leafletjs.com/)
Expand All @@ -26,6 +26,8 @@ The concepts here are not unique to .NET and could be implemented in any languag
- ImageMapper.Api - Back end API that fetches and processes image data
- ImageMapper.Web - Front end .NET Blazor web app that produces the UI to render the data on a map
- ImageMapper.Models - .NET class library of shared models

### Aspire components
- ImageMapper.AppHost - .NET Aspire orchestrator to run and debug in a development environment
- ImageMapper.ServiceDefaults - Extensions for .NET Aspire support including service discovery, health checks and telemetry

Expand Down Expand Up @@ -77,15 +79,34 @@ or for multuple image folders:

`ImageFolder` setting takes precedence over `ImageFolders` if both are present

## TODO

- Support for folder patterns in image folder config
- Support for folder exclusion
- Support for other formats including HIEF/HEIC and various raw image formats and/or anything MetadataExtractor supports (see https://github.com/drewnoakes/metadata-extractor-dotnet/blob/main/MetadataExtractor.Tools.FileProcessor/FileHandlerBase.cs)
- CSS improvements - SASS and/or Blazor CSS isolation. Not embedded in JS
- Caching. Memory and/or stored cache of processed image metadata to speed up subsequent loads and reduce processing on each request. Would need to detect changes however.
- UI improvements, filtering etc
- Error handling and logging improvements
- Container support
- Configurable map tile provider options?
- Support for varied image sources not just a file folder
## Supported Image Formats

Based on support in MetadataExtractor

### Standard Image Formats

- jpg / jpeg — JPEG Image
- png — Portable Network Graphics
- gif — Graphics Interchange Format
- bmp — Bitmap Image
- heic — High Efficiency Image Container
- heif — High Efficiency Image Format
- ico — Windows Icon File
- webp — WebP Image
- pcx — PC Paintbrush Image
- tif / tiff — Tagged Image File Format

### RAW Camera Formats

- nef — Nikon Electronic Format (RAW)
- crw — Canon RAW (CRW)
- cr2 — Canon RAW (CR2)
- orf — Olympus RAW Image
- arw — Sony RAW Image
- raf — Fujifilm RAW Image
- srw — Samsung RAW Image
- x3f — Sigma RAW Image
- rw2 — Panasonic RAW Image
- rwl — Leica RAW Image
- dcr — Kodak RAW Image
- dng — Digital Negative (Adobe)
13 changes: 13 additions & 0 deletions TODO.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# TODO

- Support for folder patterns in image folder config
- Support for folder exclusion
- Fetch from backend in batches for performance instead of or as well as front-end render batching
- CSS improvements - SASS and/or Blazor CSS isolation. Not embedded in JS
- Caching. Memory and/or stored cache of processed image metadata to speed up subsequent loads and reduce processing on each request. Would need to detect changes however.
- UI improvements, filtering etc
- Optionally show metadata with enlarged photo view
- Error handling and logging improvements
- Container support
- Configurable map tile provider options?
- Support for varied image sources not just a file folder
5 changes: 4 additions & 1 deletion src/ImageMapper.Api/Services/ImageService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,10 @@ public class ImageService : IImageService
private static readonly Dictionary<string, string> IdToPathMapping = [];
private static readonly SemaphoreSlim MappingSem = new(1, 1);

private static readonly string[] ValidExtensions = [".jpg", ".jpeg", ".png", ".tif", ".tiff", ".nef"];
private static readonly string[] ValidExtensions = [
".jpg", ".jpeg", ".png", ".gif", ".bmp", ".heic", ".heif", ".ico", ".webp", ".pcx",".tif", ".tiff",
".nef", ".crw", ".cr2", ".orf", ".arw", ".raf", ".srw", ".x3f", ".rw2", ".rwl", ".dcr", ".dng"
];

public ImageService(IConfiguration config)
{
Expand Down
4 changes: 2 additions & 2 deletions src/ImageMapper.AppHost/ImageMapper.AppHost.csproj
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<Project Sdk="Aspire.AppHost.Sdk/13.2.4">
<Project Sdk="Aspire.AppHost.Sdk/13.3.3">

<PropertyGroup>
<OutputType>Exe</OutputType>
Expand All @@ -9,7 +9,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Aspire.Hosting.Redis" Version="13.2.4" />
<PackageReference Include="Aspire.Hosting.Redis" Version="13.3.3" />
</ItemGroup>

<ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion src/ImageMapper.Web/ImageMapper.Web.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="Aspire.StackExchange.Redis.OutputCaching" Version="13.2.4" />
<PackageReference Include="Aspire.StackExchange.Redis.OutputCaching" Version="13.3.3" />
<PackageReference Include="Serilog" Version="4.3.1" />
<PackageReference Include="Serilog.Sinks.Console" Version="6.1.1" />
</ItemGroup>
Expand Down
Loading