Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support PPM files #81

Open
alanwilter opened this issue Mar 10, 2023 · 7 comments
Open

Add support PPM files #81

alanwilter opened this issue Mar 10, 2023 · 7 comments
Labels

Comments

@alanwilter
Copy link

Why sharp does not work with PPM files?

@vseventer
Copy link
Owner

You might have to compile libvips with PPM support.

@alanwilter
Copy link
Author

Is there a recipe somewhere to build sharp with PPM support? I've followed https://sharp.pixelplumbing.com/install for my basic node installation.

My platform is Ubuntu 20.04.3 LTS x86_64.

@vseventer
Copy link
Owner

Is there a recipe somewhere to build sharp with PPM support? I've followed https://sharp.pixelplumbing.com/install for my basic node installation.

My platform is Ubuntu 20.04.3 LTS x86_64.

I think you want to try and use a custom libvips with PPM support - https://sharp.pixelplumbing.com/install#custom-libvips

@alanwilter
Copy link
Author

I'm trying, I've installed Ubuntu libvips and its tools, so with nip2 I can open PPM files, I guess then ubuntu libvips supports PPM.

Then I tried:

npm install -g sharp-cli --build-from-source --verbose
npm verb cli /home/awilter/.nvm/versions/node/v18.0.0/bin/node /home/awilter/.nvm/versions/node/v18.0.0/bin/npm
npm info using npm@9.6.1
npm info using node@v18.0.0
npm verb title npm install sharp-cli
npm verb argv "install" "--global" "sharp-cli" "--build-from-source" "--loglevel" "verbose"
npm verb logfile logs-max:10 dir:/home/awilter/.npm/_logs/2023-03-14T14_53_52_348Z-
npm verb logfile /home/awilter/.npm/_logs/2023-03-14T14_53_52_348Z-debug-0.log
npm http fetch GET 200 https://registry.npmjs.org/sharp-cli 318ms (cache revalidated)
...
npm http fetch GET 200 https://registry.npmjs.org/ansi-styles 40ms (cache revalidated)
npm info run sharp@0.31.2 install node_modules/sharp-cli/node_modules/sharp (node install/libvips && node install/dll-copy && prebuild-install) || (node install/can-compile && node-gyp rebuild && node install/dll-copy)
npm info run sharp@0.31.2 install { code: 0, signal: null }

changed 70 packages in 16s

13 packages are looking for funding
  run `npm fund` for details
npm verb exit 0
npm info ok

But I doubt it did what I wanted. Anyway, sharp -i example.ppm still does not work on my linux.

What am I still missing?

@alanwilter
Copy link
Author

alanwilter commented Mar 22, 2023

I removed sharp, started with with a new nodejs, build /usr/local/include/vips, did npm install -g sharp-cli --build-from-source --verbose and after some error interaction I've installed all the lib*-dev that was missing in my Ubuntu and then I've got sharp with PPM support, Hooray!

But not for so long. In the process I managed to lose avif support, though I have installed /usr/local/include/avif.

Any clue?

@vseventer
Copy link
Owner

Not sure - my installation process on Mac using brew is a bit different - maybe worth asking in the main repos' issue tracker.

@alanwilter
Copy link
Author

I'm wondering which lib provides avif. I mean, should I have to build libvips with avif support?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants