Skip to content

Commit

Permalink
Fix date metadata for filenames with extra chars (#176)
Browse files Browse the repository at this point in the history
  • Loading branch information
stormwarning authored Oct 6, 2024
1 parent 7cd10e5 commit b0f0f07
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .changeset/perfect-rockets-agree.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@tidaltheory/lens': patch
---

Fix ModifyDate if filenames include characters after the timestamp
3 changes: 3 additions & 0 deletions src/cli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -238,6 +238,9 @@ prog.command('jpg <src>')
let sharpImage = sharp(source)
spinner.text = 'Converting to JPG...'

// Remove any non-digit characters from the end of the filename.
name = name.replace(/\D*$/, '')

let dt = name.slice(-14)
let d = dt.slice(0, 8)
let t = dt.slice(8)
Expand Down

0 comments on commit b0f0f07

Please sign in to comment.