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

Release codecs on NPM #280

Open
onigoetz opened this issue Nov 13, 2018 · 10 comments
Open

Release codecs on NPM #280

onigoetz opened this issue Nov 13, 2018 · 10 comments
Assignees
Labels
codec new codec support good first issue Good for newcomers help wanted Extra attention is needed

Comments

@onigoetz
Copy link

Hi,

do you consider releasing the codecs ( optiping / mozjpeg ...) as npm packages ?
I've tried to build them myself in the past but failed to do so.

I use imagemin in my toolbelt to compress images at build time, but as it relies on binaries downloaded on install, it's very painful on a corporate environment without internet access on build machines.

I'm pretty sure more people than just me would be interested in such a feature : imagemin/optipng-bin#71

@jakearchibald
Copy link
Collaborator

Yeah, this is a good idea & something we planned from the start.

The codecs are currently in their own folders and with their own readmes.

We just need to figure out the best way to extract them and provide them separately.

@surma surma self-assigned this Nov 14, 2018
@onigoetz
Copy link
Author

Thanks for the quick reply, looking forward to it then :) Is there anything I can help with ?

P.S. Thanks for everything you presented at Chrome Dev Summit, didn't watch everything yet, still catching up :)

@kurtommy
Copy link

Yeah @jakearchibald and @surma are working on this!
After reading the article about this project the first thing i've done was search on npm i'd like to add a prebuild script to optimise our Anuglar /assets/imgs folder that would be great, the online version is nicce and handy but it doesn't work for bulk optimisations
... looking forward the npm lib!

you know jake today i've been to visit one of our clients (top fashion brand) doing a speach about service worker PWA ... :)

@gustavopch
Copy link

Nothing yet? 😢

@tracker1
Copy link

Posted a dupe feature request (#684), apologies... Notes from my dupe.

  • Use a squoosh org in npm for the codecs
  • Publish individually
    • browser: abstraction for browser interface (for use with webpack/browserify/etc build) -- this may require special instructions for use
    • main: abstraction for node (for use with node's wasm usage)
  • Publish package with all of the individual packages referenced

@tracker1
Copy link

Would still love to see some traction on this... surprised nothing has been done as of yet.

@mohamed-rekiba
Copy link

any news?

@samal-rasmussen
Copy link
Contributor

I have a use case where we let users upload png files from the browser to a server. I would love to be able to run oxipng over it on the client side for some free space saving before sending :)

@samal-rasmussen
Copy link
Contributor

samal-rasmussen commented Aug 27, 2020

Ah the codecs are all already available as separate projects right here in the repo:
https://github.com/GoogleChromeLabs/squoosh/tree/dev/codecs

The oxipng one also has a package.json and seems almost ready to just upload to npm. Should be able to just copy/paste into your own project for now:
https://github.com/GoogleChromeLabs/squoosh/tree/dev/codecs/oxipng/pkg

Example usage right here:
https://github.com/GoogleChromeLabs/squoosh/blob/dev/src/codecs/oxipng/encoder.ts

@magicdawn
Copy link

here is addon package copy of mozjpeg (c++ code copy from squoosh), can be used in node / electron
https://github.com/magicdawn/node-mozjpeg

@kosamari kosamari added help wanted Extra attention is needed good first issue Good for newcomers labels Jul 1, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
codec new codec support good first issue Good for newcomers help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

10 participants