mediasnacks 0.16.3 → 0.16.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -122,7 +122,7 @@ For example, for `dropdups -n2 file.mov`
122
122
  - Workflow receives current: `movie files` in `Finder.app`
123
123
  - Action: `Run Shell Script`
124
124
  ```shell
125
- export PATH="/opt/homebrew/bin"
125
+ export PATH="/opt/homebrew/bin:/opt/homebrew/opt/node@24/bin"
126
126
  for f in "$@"; do
127
127
  $HOME/bin/mediasnacks dropdups -n2 "$f"
128
128
  done
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mediasnacks",
3
- "version": "0.16.3",
3
+ "version": "0.16.5",
4
4
  "description": "Utilities for optimizing and preparing videos and images for the web",
5
5
  "license": "MIT",
6
6
  "author": "Eric Fortis",
package/src/avif.js CHANGED
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env node
2
2
 
3
- import { join, basename } from 'node:path'
3
+ import { join, basename, dirname } from 'node:path'
4
4
 
5
5
  import { parseOptions } from './utils/parseOptions.js'
6
6
  import { replaceExt, lstat } from './utils/fs-utils.js'
@@ -35,7 +35,7 @@ async function main() {
35
35
  for (const file of files)
36
36
  await toAvif({
37
37
  file,
38
- outFile: join(values['output-dir'], replaceExt(basename(file), 'avif')),
38
+ outFile: join(values['output-dir'] || dirname(file), replaceExt(basename(file), 'avif')),
39
39
  overwrite: values.overwrite
40
40
  })
41
41
  }
package/src/framediff.sh CHANGED
@@ -4,10 +4,7 @@
4
4
  # I use this for finding repeated frames. For example, you’ll see
5
5
  # a black frame if two consecutive frames are almost similar.
6
6
 
7
- # The frame number is rendered at the top-left.
8
-
9
7
  ffplay -v error "$1" -vf "
10
8
  tblend=all_mode=difference,
11
- format=gray,
12
- drawtext=text='%{n}':x=20:y=20:fontcolor=white:fontsize=48
9
+ format=gray
13
10
  "
package/src/unemoji.sh CHANGED
@@ -1,12 +1,13 @@
1
1
  #!/bin/sh
2
2
 
3
- # Removes emoji's from filenames
3
+ # Removes emoji's from filenames on the current working directory.
4
+ # Does not overwrite files.
4
5
 
5
6
  find . -depth | while IFS= read -r file; do
6
7
  dir=$(dirname "$file")
7
8
  base=$(basename "$file")
8
9
 
9
- # Remove emojis using Perl's Unicode-aware regex
10
+ # Remove Emojis
10
11
  newbase=$(printf '%s' "$base" | perl -CSD -pe '
11
12
  s/[\x{1F600}-\x{1F64F}]//g; # Emoticons
12
13
  s/[\x{1F300}-\x{1F5FF}]//g; # Misc Symbols and Pictographs
@@ -18,7 +19,7 @@ find . -depth | while IFS= read -r file; do
18
19
  s/[\x{1F1E6}-\x{1F1FF}]//g; # Regional Indicator Symbols
19
20
  ')
20
21
 
21
- # Normalize
22
+ # Normalize to Unicode NFKC
22
23
  newbase=$(printf '%s' "$newbase" | perl -CSD -MUnicode::Normalize -pe '$_ = NFKC($_)')
23
24
 
24
25
  if [ "$base" != "$newbase" ]; then
@@ -1,7 +1,7 @@
1
- import { join } from 'node:path'
2
- import { tmpdir } from 'node:os'
3
- import { spawnSync } from 'node:child_process'
4
- import { createHash } from 'node:crypto'
1
+ import { join } from 'node:path'
2
+ import { tmpdir } from 'node:os'
3
+ import { spawnSync } from 'node:child_process'
4
+ import { createHash } from 'node:crypto'
5
5
  import { mkdtempSync, readFileSync, mkdirSync, writeFileSync } from 'node:fs'
6
6
 
7
7
  const rel = f => join(import.meta.dirname, f)