@poe-platform/safe-bash 0.1.828 → 0.1.829
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/dist/safe-bash/command-chunks/{chunk-FMXBLKWO.js → chunk-MWPL7AFP.js} +4 -0
- package/dist/safe-bash-command-ffmpeg/index.js +4 -2
- package/dist/safe-bash-command-ffprobe/index.js +1 -1
- package/dist/safe-bash-command-ffprobe/media.js +1 -1
- package/dist/safe-bash-command-imagemagick/index.js +10 -0
- package/package.json +2 -2
|
@@ -550,6 +550,10 @@ function parseArguments(args) {
|
|
|
550
550
|
key
|
|
551
551
|
))
|
|
552
552
|
throw new Error(`Unsupported writer option ${key}`);
|
|
553
|
+
if (sections.size === 0) {
|
|
554
|
+
sections.set("stream", void 0);
|
|
555
|
+
sections.set("format", void 0);
|
|
556
|
+
}
|
|
553
557
|
return { filename, format, sections, settings, selector, quiet };
|
|
554
558
|
}
|
|
555
559
|
function probe(data, args) {
|
|
@@ -659,8 +659,10 @@ async function applyVideoFilterChain(frames, filterChainStr, budget, subtitleCue
|
|
|
659
659
|
...f,
|
|
660
660
|
data: await renderBitmapTextToRgba(f.data, f.width, f.height, cueStr, {
|
|
661
661
|
xExpr: "(w-text_w)/2",
|
|
662
|
-
|
|
663
|
-
|
|
662
|
+
// FFmpeg's default SRT style uses a 16-point font and 10-point
|
|
663
|
+
// vertical margin on a 288-pixel reference canvas.
|
|
664
|
+
yExpr: `h-text_h-${Math.max(4, Math.round(10 * f.height / 288))}`,
|
|
665
|
+
fontSize: 16 * f.height / 288,
|
|
664
666
|
fontColor: [255, 255, 255, 255],
|
|
665
667
|
drawBox: true,
|
|
666
668
|
boxColor: [0, 0, 0, 180]
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
createFfprobeCommand
|
|
3
|
-
} from "../safe-bash/command-chunks/chunk-
|
|
3
|
+
} from "../safe-bash/command-chunks/chunk-MWPL7AFP.js";
|
|
4
4
|
import "../safe-bash/command-chunks/chunk-MGBHGZEX.js";
|
|
5
5
|
import "../safe-bash/command-chunks/chunk-BXOBM4HJ.js";
|
|
6
6
|
import "../safe-bash/command-chunks/chunk-65DS4IOB.js";
|
|
@@ -11,7 +11,7 @@ import {
|
|
|
11
11
|
loadManifestResources,
|
|
12
12
|
resolvePath,
|
|
13
13
|
rethrowRuntimeError
|
|
14
|
-
} from "../safe-bash/command-chunks/chunk-
|
|
14
|
+
} from "../safe-bash/command-chunks/chunk-MWPL7AFP.js";
|
|
15
15
|
import "../safe-bash/command-chunks/chunk-MGBHGZEX.js";
|
|
16
16
|
import "../safe-bash/command-chunks/chunk-BXOBM4HJ.js";
|
|
17
17
|
import "../safe-bash/command-chunks/chunk-65DS4IOB.js";
|
|
@@ -4207,6 +4207,14 @@ function* magickDrawSteps(img, drawCmd, state) {
|
|
|
4207
4207
|
stroke = rgbaToCss(parseColor(tokens[i++] ?? "#000000"));
|
|
4208
4208
|
} else if (cmd === "stroke-width" || cmd === "strokewidth") {
|
|
4209
4209
|
strokeWidth = Math.max(0, num());
|
|
4210
|
+
} else if (cmd === "color") {
|
|
4211
|
+
const x = num(), y = num(), method = tokens[i++]?.toLowerCase();
|
|
4212
|
+
if (method !== "floodfill" || !Number.isFinite(x) || !Number.isFinite(y)) throw new Error("Color drawing requires finite coordinates and the floodfill method");
|
|
4213
|
+
if (svgElements.length > 0) {
|
|
4214
|
+
yield { kind: "svg", svg: `<svg xmlns="http://www.w3.org/2000/svg" width="${img.width}" height="${img.height}">${svgElements.join("")}</svg>` };
|
|
4215
|
+
svgElements.length = 0;
|
|
4216
|
+
}
|
|
4217
|
+
yield { kind: "floodfill", x: Math.max(0, Math.min(img.width - 1, Math.round(x))), y: Math.max(0, Math.min(img.height - 1, Math.round(y))), color: parseColor(fill) };
|
|
4210
4218
|
} else if (cmd === "rectangle") {
|
|
4211
4219
|
const x0 = num();
|
|
4212
4220
|
const y0 = num();
|
|
@@ -5698,6 +5706,7 @@ function* evaluatePipelineTokensSteps(tokens, files, state, parentStack = [], st
|
|
|
5698
5706
|
continue;
|
|
5699
5707
|
}
|
|
5700
5708
|
if (step.kind === "shape") im = yield* applyMagickRasterSteps(im, drawShapePixelSteps(im, step), signal);
|
|
5709
|
+
else if (step.kind === "floodfill") im = yield* applyMagickFloodfillSteps(im, `+${step.x}+${step.y}`, void 0, step.color, state.fuzz, signal);
|
|
5701
5710
|
else {
|
|
5702
5711
|
const overlay = decodeImage3(new TextEncoder().encode(step.svg), { density: state.density });
|
|
5703
5712
|
im = yield* applyMagickRasterSteps(im, drawOverlayPixelSteps(im, overlay), signal, im, [im, overlay]);
|
|
@@ -6458,6 +6467,7 @@ async function tryConvertFiles(argv, input, stdinBytes, signal) {
|
|
|
6458
6467
|
continue;
|
|
6459
6468
|
}
|
|
6460
6469
|
if (step.kind === "shape") image = await transformStoredMagickRaster(image, backend, drawShapePixelSteps(image, step), signal);
|
|
6470
|
+
else if (step.kind === "floodfill") image = await floodfillStoredImage(image, backend.storage, step.x, step.y, void 0, step.color, settings.fuzz, signal);
|
|
6461
6471
|
else {
|
|
6462
6472
|
const overlay = await decodeStoredMagickSvg(step.svg, settings.density, backend, signal);
|
|
6463
6473
|
image = await transformStoredMagickRaster(image, backend, drawOverlayPixelSteps(image, overlay), signal, image, [image, overlay]);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@poe-platform/safe-bash",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.829",
|
|
4
4
|
"description": "Extensible virtual shell with pluggable filesystems and streaming commands",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -1415,7 +1415,7 @@
|
|
|
1415
1415
|
"access": "public"
|
|
1416
1416
|
},
|
|
1417
1417
|
"dependencies": {
|
|
1418
|
-
"@poe-platform/safe-fs": "0.1.
|
|
1418
|
+
"@poe-platform/safe-fs": "0.1.829",
|
|
1419
1419
|
"pdf-lib": "1.17.1",
|
|
1420
1420
|
"@types/node": "^25.2.2",
|
|
1421
1421
|
"@formatjs/intl-numberformat": "9.4.0",
|