asciianything 1.2.2 → 1.2.3

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.
Files changed (3) hide show
  1. package/README.md +1 -1
  2. package/package.json +1 -1
  3. package/src/cli.js +5 -1
package/README.md CHANGED
@@ -39,7 +39,7 @@ emitted colour. No zoom, pan, transition, grain or vignette is ever added.
39
39
  | input | command | output |
40
40
  | --- | --- | --- |
41
41
  | video — mp4, mov, webm, gif, anything ffmpeg decodes | `asciianything clip.mp4` | `clip-ascii.mp4` |
42
- | photo — png, jpg, webp, avif, tiff, bmp | `asciianything shot.jpg` | `shot-ascii.png` |
42
+ | photo — png, jpg, webp, avif, tiff, bmp | `asciianything shot.jpg` | `shot-ascii.png` (a PNG whatever `-o` says) |
43
43
  | frame sequence — a folder of numbered PNGs | `asciianything frames/ --fps 60` | `frames-ascii.mp4` |
44
44
 
45
45
  **3D scenes.** A three.js scene is a frame sequence waiting to happen: render it to PNGs (`renderer.render()` in a loop
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "asciianything",
3
- "version": "1.2.2",
3
+ "version": "1.2.3",
4
4
  "description": "Turn a 3D scene, a video or a photo into a mosaic of coloured lowercase prose \u2014 frame-accurate, with ffmpeg.",
5
5
  "keywords": [
6
6
  "ascii",
package/src/cli.js CHANGED
@@ -247,7 +247,11 @@ async function main() {
247
247
  if (isImage || values.still !== undefined) {
248
248
  const at = isImage ? 0 : Number(values.still);
249
249
  const png = await renderStill(input, at, renderer, meta);
250
- const out = values.out || `${path.basename(input, path.extname(input))}-ascii.png`;
250
+ let out = values.out || `${path.basename(input, path.extname(input))}-ascii.png`;
251
+ if (path.extname(out).toLowerCase() !== '.png') {
252
+ out = `${out.slice(0, out.length - path.extname(out).length)}.png`;
253
+ if (!quiet) console.error(`one frame: writing PNG -> ${out}`);
254
+ }
251
255
  fs.writeFileSync(out, png);
252
256
  if (!quiet) console.error(`wrote ${out}`);
253
257
  return;