Giter VIP home page Giter VIP logo

Comments (4)

vseventer avatar vseventer commented on June 16, 2024

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.

oupala avatar oupala commented on June 16, 2024

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.

vseventer avatar vseventer commented on June 16, 2024

My bad - should be fixed now.

from sharp-cli.

oupala avatar oupala commented on June 16, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.