Comments (4)
I'm turning this into a bug ticket. The dependency used for output format parsing, url-template, is not designed for path parsing. I need to figure out a different solution.
from sharp-cli.
Thanks for adding this feature so fast!
Unfortunately, I did not manage to make it work:
$ npx sharp-cli resize 800 800 --withoutEnlargement true --optimise true --progressive true --withMetadata false --format input --fit inside --input './docs/images/**/*.jpg' --output {dir}/{base}
info sharp Using cached /home/user/.npm/_libvips/libvips-8.8.1-linux-x64.tar.gz
ENOENT: no such file or directory, open '/home/user/path/to/website//home/user/path/to/website/docs/images/photos/chambre_balcon.jpg'Specify --help for available options
As you can see, there seems to be a problem in the path mentionned in the error: the absolute path is considered as a relative one.
It looks like {dir}
is added twice.
from sharp-cli.
My bad - should be fixed now.
from sharp-cli.
It appears to work well.
I still have another problem, but this might require a new issue.
I also want sharp-cli to optimize images that are in a hidden directory.
With bash, I can set how bash behave with setting a specific shopt option:
$ shopt -u dotglob
$ ls docs/**/*.jpg
$
$ shopt -s dotglob
$ ls docs/**/*.jpg
docs/.hidden/image.jpg
$
Is there a way to set a similar option for sharp-cli? If not, could it be possible to add options to set how sharp-cli behave?
$ npx sharp-cli --include-hidden-files
$ npx sharp-cli --include-hidden-directory
from sharp-cli.
Related Issues (20)
- Resize by percentage HOT 2
- Remove people's data from the git history HOT 1
- Update `sharp` dependency to `v0.28` to support `AVIF` format
- Overwriting the input files failes in Node v16.4.1 HOT 1
- Does not Install on ARM64 M1 Apple Silicone HOT 2
- Specifying quality changes PNG file format to ISO Media HOT 4
- CPU usage low... HOT 3
- Option to delete original? HOT 3
- How to specify background/border color for `extend`? HOT 5
- Support for composite multiple images HOT 5
- NPM flags 3 moderate severity vulnerabilities upon install HOT 3
- Proposal: Add `--animated` Global Option HOT 2
- Add support PPM files HOT 7
- avif output ext wrong HOT 2
- Input file specification on windows - Backslash HOT 6
- Possible to add output option to buffer HOT 2
- sharp-cli vs sharp
- How to rasterize SVGs on PNG with specific width/height? HOT 4
- Greyscale conversion is not working HOT 6
- Installation does not work on Manjaro
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from sharp-cli.