This project contains a prompt and Python script for creating an HTML report of duplicate and unique photo files.
The prompt in duplicate_photo_report_prompt.md asks a coding assistant to review and improve find_duplicates.py.
It describes a task where the script should:
- Scan a target folder for image files.
- Calculate a SHA256 hash for each photo.
- Group photos with matching hashes as exact duplicates.
- Separate photos that appear only once as unique files.
- Create an HTML report named
duplicate_report.html.
The generated HTML file should contain two tables.
This table lists every photo that belongs to a duplicate group.
Columns:
- Hash Tag number
- Photo Name
- Photo Size
- Folder
Photos with the same file hash should share the same hash tag number.
This table lists photos whose hash appears only once.
Columns:
- Hash Tag number
- Photo Name
- Photo Size
- Folder
The prompt also asks that the code:
- Saves the HTML report in the same folder as
find_duplicates.py. - Escapes file names and folder paths before writing them into HTML.
- Formats photo sizes in readable units such as
KB,MB, orGB. - Shows a clear message if either table has no rows.
- Keeps the implementation simple and readable.
- Verifies that the report can be created successfully.
find_duplicates.py: Python script that scans photos and creates the report.duplicate_report.html: Generated HTML report.duplicate_photo_report_prompt.md: Reusable prompt describing the task.