Skip to content

Instantly share code, notes, and snippets.

@lukeross
Created February 22, 2024 21:16
Show Gist options
  • Save lukeross/448902ba8d868c2925f41710b3e034d7 to your computer and use it in GitHub Desktop.
Save lukeross/448902ba8d868c2925f41710b3e034d7 to your computer and use it in GitHub Desktop.
Backfill Shotwell exposure _time for WhatsApp photos and videos
/*
* WhatsApp photos in shotwell don't get an exposure time set, but it can be backfilled from the filename
* sqlite3 .local/share/shotwell/photo.db
*/
update videotable set exposure_time=unixepoch(substring(filename, -19, 4)||"-"||substring(filename, -15, 2)||"-"||substring(filename, -13, 2)||"T00:00:00") where filename like "%VID-%-WA%.mp4" and exposure_time=0;
update phototable set exposure_time=unixepoch(substring(filename, -19, 4)||"-"||substring(filename, -15, 2)||"-"||substring(filename, -13, 2)||"T00:00:00") where filename like "%IMG-%-WA%.jpg" and exposure_time=0;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment