diff --git a/.changeset/perfect-rockets-agree.md b/.changeset/perfect-rockets-agree.md new file mode 100644 index 0000000..a19f0b4 --- /dev/null +++ b/.changeset/perfect-rockets-agree.md @@ -0,0 +1,5 @@ +--- +'@tidaltheory/lens': patch +--- + +Fix ModifyDate if filenames include characters after the timestamp diff --git a/src/cli.ts b/src/cli.ts index 1a640f1..400df67 100644 --- a/src/cli.ts +++ b/src/cli.ts @@ -238,6 +238,9 @@ prog.command('jpg ') 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)