Image Metadata Catalog
Build a service in C# that scans folders of images, extracts each image's metadata (dimensions, format, file size, camera, date taken, and GPS location from EXIF data), stores it in PostgreSQL, and offers an ASP.NET Core API to search the catalog, for example all landscape photos taken with a certain camera in 2025. The scanner runs in the background, only processes new or changed files, notices deleted ones, and keeps going when it finds a broken file. You'll learn reading image metadata with MetadataExtractor, background services in .NET, incremental scanning, storing and querying data with EF Core and PostgreSQL, designing search endpoints, and testing.
- Estimate
- ~12h
- Steps
- 6
- Completed by
- 0
- Proposed by
- codeseed.app
ASP.NET Core · System.Text.Json · PostgreSQL
Project roadmap
- 01
Define the catalog
~1.5hWrite API.md: the metadata stored per image (path, file size, modified time, a content hash, format, width, height, orientation, camera make and model, date taken, and GPS latitude and longitude if present), the search endpoint GET /images with filters (camera, format, orientation, taken date range, minimum width, has GPS and text in the path) and paging, GET /images/{id}, and POST /scans to start a scan. Done when: API.md defines the data and endpoints.
- 02
Extract metadata
~2hCreate a class that reads a file with the MetadataExtractor library and returns the fields, handling images without EXIF, different date formats, GPS in degrees, minutes and seconds (converted to decimal), and orientation. Catch errors for corrupted files and return a clear failure instead of throwing. Done when: unit tests extract correct metadata from sample images with and without EXIF.
- 03
Store metadata with EF Core
~2hCreate an EF Core model and migration for images with indexes for the searchable fields (camera, date taken and a unique index on path), using PostgreSQL through Npgsql. Store scan runs with their counts and errors. Done when: the database is created by the migration and images can be saved and queried.
- 04
Scan folders in the background
~2.5hWrite a BackgroundService that scans the configured folders when requested or on a schedule: skip files whose size and modified time haven't changed since the last scan, extract and upsert new or changed ones in batches, remove entries for files that no longer exist, and record errors without stopping. Process files with limited parallelism. Done when: a second scan of an unchanged folder is fast and changes nothing, and new, changed and deleted files are handled.
- 05
Build the search API
~2hImplement GET /images with the filters combined in one EF Core query (only adding conditions for the filters given), sorting, and paging with a maximum page size, returning DTOs serialized with System.Text.Json. Validate query parameters and return 400 for invalid ones. Add GET /scans/{id} to follow a scan's progress. Done when: combined filters return exactly the matching images.
- 06
Test it
~2hWrite tests: metadata extraction with sample files, the scanner with a temporary folder (adding, changing and deleting files), and API integration tests with WebApplicationFactory and PostgreSQL in Testcontainers covering filters, paging and validation. Done when: dotnet test passes.
Ready to build this?
Get a GitHub repo and start building. Your AI reviewer checks each step as you go.
Tech stack