axe312ger / sqip

"SQIP" (pronounced \skwɪb\ like the non-magical folk of magical descent) is a SVG-based LQIP technique.
http://axe312ger.github.io/sqip
The Unlicense
3.37k stars 82 forks source link

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

Open xerc opened 7 months ago

xerc commented 7 months ago

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

axe312ger commented 7 months ago

Good idea!

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

Thanks!

xerc commented 7 months ago

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

xerc commented 7 months ago

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

axe312ger commented 7 months ago

@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 commented 6 months ago

@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

xerc commented 6 months ago

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",
axe312ger commented 6 months ago

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

axe312ger commented 6 months ago

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.

xerc commented 6 months ago

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');