Build Time Automation from Photos

From Open Source Ecology
Jump to navigation Jump to search

https://chatgpt.com/share/696f38a6-2d20-8010-bd17-26154b0e6d92

Automated Extraction of Build Time from Photos (Steps 1–8)

Step 1: Define the Photo Time Range

Use Google Photos search to select the relevant date range (for example, a specific build phase or start date). Select all photos in the range and add them to a new album. Name the album clearly (e.g., Build Photos – Phase 1). This album becomes the authoritative boundary of the dataset.

Step 2: Export Photos and Metadata via Google Takeout

Go to https://takeout.google.com. Deselect all services except Google Photos. Choose “All photo albums included” and select only the build album. Export as ZIP. This produces media files plus JSON sidecar files containing authoritative timestamps.

Step 3: Prepare a Local Working Directory

Extract the Takeout ZIP into a raw archive directory. Create a separate working copy for analysis. Never modify the raw archive; all processing happens on the working copy.

Step 4: Normalize Filenames with Timestamps

Read each photo’s JSON sidecar file. Extract the photoTakenTime timestamp. Rename each media file to: YYYY-MM-DD_HH-MM-SS__OriginalFilename.ext This makes chronological ordering explicit and reproducible.

Step 5: Bulk Metadata Extraction

Use ExifTool to extract metadata for all photos and videos into a CSV file. Include multiple timestamp fields to ensure coverage across photos and videos. The output CSV contains one row per media file with candidate timestamps.

Step 6: Select the Best Timestamp and Normalize Timezones

For each file, select the best available timestamp in priority order (e.g., DateTimeOriginal, then MediaCreateDate). Convert timestamps to a single local timezone. Discard files with no valid timestamp. The result is a clean per-file timestamp table.

Step 7: Compute Daily Time Spans

Group photos by local calendar date. For each day:

  • Identify the first photo timestamp.
  • Identify the last photo timestamp.
  • Compute the daily span as the difference between them.

This span represents the maximum possible work window for that day.

Step 8: Compute Build Time Using a Lunch-Gap Rule

Within each day, sort photos by time. Compute gaps between consecutive photos. If a gap exceeds one hour, interpret it as lunch. Subtract the excess time beyond one hour from the daily span. If no gap exceeds one hour, treat the day as continuous work. The result is the daily build time derived from photographic evidence.