sqip icon indicating copy to clipboard operation
sqip copied to clipboard

Accept `process.stdin` as image `--input`

Open xerc opened this issue 1 year ago • 9 comments

sqip -i test.jpg => curl -q https://[..]/test.jpg | sqip

https://github.com/axe312ger/sqip/blob/91f9928c0a06cd3d7fc6a0284bb965a9098f8bfa/packages/sqip-cli/src/sqip-cli.ts#L36-L39 https://github.com/axe312ger/sqip/blob/91f9928c0a06cd3d7fc6a0284bb965a9098f8bfa/packages/sqip-cli/src/sqip-cli.ts#L167-L170

xerc avatar Feb 08 '24 14:02 xerc

Good idea!

Would you be so kind to open a PR? Not sure yet when I find time for it.

Thanks!

axe312ger avatar Feb 19 '24 14:02 axe312ger

@axe312ger would like to but i get a lot of DeprecationWarnings and ERR somewhere with node-gyp while npm install

xerc avatar Feb 19 '24 19:02 xerc

ref. https://github.com/yarnpkg/yarn/issues/9005 & https://github.com/yarnpkg/yarn/issues/9013

xerc avatar Feb 19 '24 19:02 xerc

@xerc the errors you refer to are for node v21.

The project installs fine for me on OSX (on my M1) and Linux (in CI) for node v18 and v20.

Maybe try again with node 18 or 20 :)

axe312ger avatar Feb 20 '24 10:02 axe312ger

@xerc i got rid of plenty of very old dependencies, can you check if you can clone and build the project now properly on your machine? #342

axe312ger avatar Mar 02 '24 15:03 axe312ger

look good @node v20 besides these two missing packages..

diff --git package.json
   "devDependencies": {
+    "@types/debug": "4.1.12",
+    "@types/fs-extra": "11.0.4",

xerc avatar Mar 02 '24 17:03 xerc

@xerc awesome. I'll add them to master right away!

axe312ger avatar Mar 05 '24 13:03 axe312ger

Okay, thats done as well.

About the process.stdin -> I wanna do this soon, probably also redo some of the logic that reads files and change how meta data is extracted and passed through the plugins.

axe312ger avatar Mar 05 '24 14:03 axe312ger

good idea ; incl. the checks for output and print // if you want to pre-tests the "hacky" way.. [166] args['input'] = Buffer.concat(await process.stdin.toArray()).toString('utf-8');

xerc avatar Mar 05 '24 16:03 xerc