sharp
sharp-libvips
Our great sponsors
sharp | sharp-libvips | |
---|---|---|
96 | 3 | |
27,769 | 162 | |
- | - | |
9.4 | 8.5 | |
6 days ago | 5 days ago | |
JavaScript | Shell | |
Apache License 2.0 | Apache License 2.0 |
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.
sharp
-
Organize the mess of your photo folders with Node
sharp
-
Creating Chess Board SVGs, PNGs, and GIFs
For simplicity, I will be generating PNGs with JavaScript/Node and the Sharp image library. Any library that can convert between pixel arrays and image files will make the process quite straightforward.
-
My Journey to Accelerate Load Times in Heavy Frontend
There is also a library that Next.js itself uses: sharp. It can be setup as Node.js service. I even played around a little: image-proxy-service
-
Automated Image Compression: A Vite Plugin Using Sharp
Sharp Documentation: Link
- Using SVG to create simple sparkline charts
-
JavaScript Gom Jabbar
ESLint does an amazing job in detecting floating promises. I've not had it miss one, ever. When adding this to a project, I've discovered multiple accidental bugs due to a missing "await" keyword--bugs that were extremely subtle and intermittent in many cases.
The only thing it can't do is determine that you actually did handle the promise later. Which is fine. It's a LINTING RULE, and false positives are the name of the game.
What's BAD is when you accidentally miss handling a promise at all. It's an invisible error without the linting rule.
Your other comments...don't even make sense. You're going to build a Lanczos filter by hand? Or you're only going to ... compile ImageMagick to WebAssembly?!, ... an implementation which is tremendously slower (nearly unusably so for large images) than that of Sharp:
https://www.npmjs.com/package/sharp
... which is simply an import away?
No, what you're doing is called "motivated reasoning." You've concluded that Deno is the best, and you're reinterpreting all of my complaints in convoluted ways to support your predetermined conclusion.
Standard fanboy behavior. Or troll behavior. I cite Poe's Law as why it's impossible to tell the difference.
-
How to create YOLOv8-based object detection web service using Python, Julia, Node.js, JavaScript, Go and Rust
sharp - An image processing library
-
Automatic Responsive Image Generation with an Astro Hook
To actually edit the images, we are going to use sharp. Sharp is a high-performance image processing library. You can do all the cool things we want to do with it. Install the library then import it with import sharp from 'sharp'.
-
10 Powerful Node.js Libraries Every Developer Should Know About
2. sharp
-
Pixel art usermod
I've run this on a few SBCs (single board computers). A Raspberry Pi Zero 2W is adequate for the job. The demo is running on a OrangePi Lite2, which is nominally more powerful, but not as well supported, software-wise. Compiling the image procesing software (sharp) under Ambian was pretty hit and miss, whereas on Raspbian it is plug and play.
sharp-libvips
-
Deploying to Netlify
6:34:07 AM: Build ready to start 6:34:09 AM: build-image version: 2cee85eb7f808bf3b6e87378c5307f9411f0a332 6:34:09 AM: build-image tag: v3.8.0 6:34:09 AM: buildbot version: 7ed3dd8fac64067d9cac4a8ffcf331d1669e61a3 6:34:09 AM: Fetching cached dependencies 6:34:09 AM: Failed to fetch cache, continuing with build 6:34:09 AM: Starting to prepare the repo for build 6:34:09 AM: No cached dependencies found. Cloning fresh repo 6:34:09 AM: git clone https://github.com/beespirited/Turn-the-Tides 6:34:11 AM: Preparing Git Reference refs/heads/main 6:34:12 AM: Parsing package.json dependencies 6:34:13 AM: Starting build script 6:34:13 AM: Installing dependencies 6:34:13 AM: Python version set to 2.7 6:34:14 AM: v12.18.0 is already installed. 6:34:15 AM: Now using node v12.18.0 (npm v6.14.4) 6:34:15 AM: Started restoring cached build plugins 6:34:15 AM: Finished restoring cached build plugins 6:34:15 AM: Attempting ruby version 2.7.2, read from environment 6:34:16 AM: Using ruby version 2.7.2 6:34:16 AM: Using PHP version 5.6 6:34:16 AM: Started restoring cached node modules 6:34:16 AM: Finished restoring cached node modules 6:34:17 AM: Installing NPM modules using NPM version 6.14.4 6:34:58 AM: npm WARN read-shrinkwrap This version of npm is compatible with lockfileVersion@1, but package-lock.json was generated for lockfileVersion@2. I'll try to do my best with it! 6:34:58 AM: > [email protected] install /opt/build/repo/node_modules/sharp 6:34:58 AM: > (node install/libvips && node install/dll-copy && prebuild-install) || (node install/can-compile && node-gyp rebuild && node install/dll-copy) 6:35:00 AM: sharp: Downloading https://github.com/lovell/sharp-libvips/releases/download/v8.10.6/libvips-8.10.6-linux-x64.tar.br 6:35:02 AM: > [email protected] postinstall /opt/build/repo/node_modules/babel-runtime/node_modules/core-js 6:35:02 AM: > node -e "try{require('./postinstall')}catch(e){}" 6:35:02 AM: > [email protected] postinstall /opt/build/repo/node_modules/core-js 6:35:02 AM: > node -e "try{require('./postinstall')}catch(e){}" 6:35:02 AM: > [email protected] postinstall /opt/build/repo/node_modules/core-js-pure 6:35:02 AM: > node -e "try{require('./postinstall')}catch(e){}" 6:35:03 AM: > [email protected] postinstall /opt/build/repo/node_modules/gatsby-telemetry 6:35:03 AM: > node src/postinstall.js || true 6:35:03 AM: > [email protected] postinstall /opt/build/repo/node_modules/mozjpeg 6:35:03 AM: > node lib/install.js 6:35:04 AM: ✔ mozjpeg pre-build test passed successfully 6:35:04 AM: > [email protected] postinstall /opt/build/repo/node_modules/pngquant-bin 6:35:04 AM: > node lib/install.js 6:35:04 AM: ✔ pngquant pre-build test passed successfully 6:35:04 AM: > [email protected] postinstall /opt/build/repo/node_modules/gatsby-cli 6:35:04 AM: > node scripts/postinstall.js 6:35:04 AM: > [email protected] postinstall /opt/build/repo/node_modules/gatsby 6:35:04 AM: > node scripts/postinstall.js 6:35:06 AM: npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules/webpack-dev-server/node_modules/fsevents): 6:35:06 AM: npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"}) 6:35:06 AM: npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules/fsevents): 6:35:06 AM: npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"}) 6:35:06 AM: added 2208 packages from 1094 contributors and audited 2214 packages in 49.037s 6:35:08 AM: 232 packages are looking for funding 6:35:08 AM: run `npm fund` for details 6:35:08 AM: found 12 vulnerabilities (4 moderate, 8 high) 6:35:08 AM: run `npm audit fix` to fix them, or `npm audit` for details 6:35:08 AM: NPM modules installed 6:35:09 AM: Started restoring cached go cache 6:35:09 AM: Finished restoring cached go cache 6:35:09 AM: go version go1.14.4 linux/amd64 6:35:09 AM: go version go1.14.4 linux/amd64 6:35:09 AM: Installing missing commands 6:35:09 AM: Verify run directory 6:35:09 AM: 6:35:09 AM: ──────────────────────────────────────────────────────────────── 6:35:09 AM: Netlify Build 6:35:09 AM: ──────────────────────────────────────────────────────────────── 6:35:09 AM: 6:35:09 AM: ❯ Version 6:35:09 AM: @netlify/build 12.10.0 6:35:09 AM: 6:35:09 AM: ❯ Flags 6:35:09 AM: deployId: 60d95f4f99dd7ce911065b52 6:35:09 AM: 6:35:09 AM: ❯ Current directory 6:35:09 AM: /opt/build/repo 6:35:09 AM: 6:35:09 AM: ❯ Config file 6:35:09 AM: No config file was defined: using default values. 6:35:09 AM: 6:35:09 AM: ❯ Context 6:35:09 AM: production 6:35:09 AM: 6:35:09 AM: ──────────────────────────────────────────────────────────────── 6:35:09 AM: 1. Build command from Netlify app 6:35:09 AM: ──────────────────────────────────────────────────────────────── 6:35:09 AM: 6:35:09 AM: $ npm run build 6:35:09 AM: > [email protected] build /opt/build/repo 6:35:09 AM: > gatsby build 6:35:12 AM: success open and validate gatsby-configs - 0.052s 6:35:13 AM: success load plugins - 0.905s 6:35:13 AM: success onPreInit - 0.050s 6:35:13 AM: success initialize cache - 0.006s 6:35:13 AM: success copy gatsby files - 0.057s 6:35:14 AM: success Compiling Gatsby Functions - 0.350s 6:35:14 AM: success onPreBootstrap - 0.369s 6:35:14 AM: success createSchemaCustomization - 0.005s 6:35:14 AM: success Checking for changed pages - 0.000s 6:35:14 AM: success source and transform nodes - 0.364s 6:35:15 AM: success building schema - 0.809s 6:35:15 AM: success createPages - 0.005s 6:35:15 AM: success createPagesStatefully - 0.119s 6:35:15 AM: info Total nodes: 168, SitePage nodes: 12 (use --verbose for breakdown) 6:35:15 AM: success Checking for changed pages - 0.000s 6:35:15 AM: success update schema - 0.149s 6:35:15 AM: success onPreExtractQueries - 0.000s 6:35:18 AM: success extract queries from components - 2.688s 6:35:19 AM: success write out redirect data - 1.032s 6:35:19 AM: warning The icon(src/images/logo-images/Turn_the_tides_logo.svg) you provided to 'gatsby-plugin-manifest' is not square. 6:35:19 AM: The icons we generate will be square and for the best results we recommend you provide a square icon. 6:35:29 AM: success Build manifest and related icons - 9.786s 6:35:29 AM: success onPostBootstrap - 9.841s 6:35:29 AM: info bootstrap finished - 19.087s 6:35:29 AM: success run static queries - 0.010s - 1/1 100.64/s 6:35:47 AM: success run page queries - 17.926s - 12/12 0.67/s 6:35:47 AM: success write out requires - 0.007s 6:37:27 AM: failed Building production JavaScript and CSS bundles - 100.490s 6:37:27 AM: error Generating JavaScript bundles failed 6:37:27 AM: Can't resolve 'react-helmet' in '/opt/build/repo/src/components' 6:37:27 AM: If you're trying to use a package make sure that 'react-helmet' is installed. If you're trying to use a local file make sure that the path is correct. 6:37:27 AM: error Generating JavaScript bundles failed 6:37:27 AM: Can't resolve 'react-helmet' in '/opt/build/repo/src/components' 6:37:27 AM: If you're trying to use a package make sure that 'react-helmet' is installed. If you're trying to use a local file make sure that the path is correct. 6:37:33 AM: (sharp:1572): GLib-CRITICAL **: 05:37:33.112: g_hash_table_lookup: assertion 'hash_table != NULL' failed 6:37:33 AM: (sharp:1572): GLib-CRITICAL **: 05:37:33.112: g_hash_table_insert_internal: assertion 'hash_table != NULL' failed 6:37:33 AM: (sharp:1572): GLib-CRITICAL **: 05:37:33.112: g_hash_table_lookup: assertion 'hash_table != NULL' failed 6:37:33 AM: Segmentation fault 6:37:33 AM: npm ERR! code ELIFECYCLE 6:37:33 AM: npm ERR! errno 139 6:37:33 AM: npm ERR! [email protected] build: `gatsby build` 6:37:33 AM: npm ERR! Exit status 139 6:37:33 AM: npm ERR! 6:37:33 AM: npm ERR! Failed at the [email protected] build script. 6:37:33 AM: npm ERR! This is probably not a problem with npm. There is likely additional logging output above. 6:37:33 AM: npm ERR! A complete log of this run can be found in: 6:37:33 AM: npm ERR! /opt/buildhome/.npm/_logs/2021-06-28T05_37_33_288Z-debug.log 6:37:33 AM: 6:37:33 AM: ──────────────────────────────────────────────────────────────── 6:37:33 AM: "build.command" failed 6:37:33 AM: ──────────────────────────────────────────────────────────────── 6:37:33 AM: 6:37:33 AM: Error message 6:37:33 AM: Command failed with exit code 139: npm run build 6:37:33 AM: 6:37:33 AM: Error location 6:37:33 AM: In Build command from Netlify app: 6:37:33 AM: npm run build 6:37:33 AM: 6:37:33 AM: Resolved config 6:37:33 AM: build: 6:37:33 AM: command: npm run build 6:37:33 AM: commandOrigin: ui 6:37:33 AM: publish: /opt/build/repo/public 6:37:33 AM: publishOrigin: ui 6:37:33 AM: functions: 6:37:33 AM: '*': {} 6:37:33 AM: Caching artifacts 6:37:33 AM: Started saving node modules 6:37:33 AM: Finished saving node modules 6:37:33 AM: Started saving build plugins 6:37:33 AM: Finished saving build plugins 6:37:33 AM: Started saving pip cache 6:37:33 AM: Finished saving pip cache 6:37:33 AM: Started saving emacs cask dependencies 6:37:33 AM: Finished saving emacs cask dependencies 6:37:33 AM: Started saving maven dependencies 6:37:33 AM: Finished saving maven dependencies 6:37:33 AM: Started saving boot dependencies 6:37:33 AM: Finished saving boot dependencies 6:37:33 AM: Started saving rust rustup cache 6:37:33 AM: Finished saving rust rustup cache 6:37:33 AM: Started saving go dependencies 6:37:33 AM: Finished saving go dependencies 6:37:36 AM: Build failed due to a user error: Build script returned non-zero exit code: 2 6:37:36 AM: Creating deploy upload records 6:37:36 AM: Failing build: Failed to build site 6:37:36 AM: Failed during stage 'building site': Build script returned non-zero exit code: 2 6:37:36 AM: Finished processing build request in 3m27.064755572s
-
How to get next.js and vercel to work on M1 mac
warning Error running install script for optional dependency: "/***/blog/node_modules/sharp: Command failed. Exit code: 1 Command: (node install/libvips && node install/dll-copy && prebuild-install) || (node-gyp rebuild && node install/dll-copy) Arguments: Directory: /***/blog/node_modules/sharp Output: info sharp Downloading https://github.com/lovell/sharp-libvips/releases/download/v8.10.0/libvips-8.10.0-darwin-arm64v8.tar.br ERR! sharp Prebuilt libvips 8.10.0 binaries are not yet available for darwin-arm64v8 info sharp Attempting to build from source via node-gyp but this may fail due to the above error info sharp Please see https://sharp.pixelplumbing.com/install for required dependencies gyp info it worked if it ends with ok gyp info using [email protected] gyp info using [email protected] | darwin | arm64 gyp info find Python using Python version 3.9.1 found at \"/opt/homebrew/opt/[email protected]/bin/python3.9\" gyp info spawn /opt/homebrew/opt/[email protected]/bin/python3.9 gyp info spawn args [ gyp info spawn args '/opt/homebrew/Cellar/node/15.5.0/libexec/lib/node_modules/npm/node_modules/node-gyp/gyp/gyp_main.py', gyp info spawn args 'binding.gyp', gyp info spawn args '-f', gyp info spawn args 'make', gyp info spawn args '-I', gyp info spawn args '/***/blog/node_modules/sharp/build/config.gypi', gyp info spawn args '-I', gyp info spawn args '/opt/homebrew/Cellar/node/15.5.0/libexec/lib/node_modules/npm/node_modules/node-gyp/addon.gypi', gyp info spawn args '-I', gyp info spawn args '/Users/***/Library/Caches/node-gyp/15.5.0/include/node/common.gypi', gyp info spawn args '-Dlibrary=shared_library', gyp info spawn args '-Dvisibility=default', gyp info spawn args '-Dnode_root_dir=/Users/***/Library/Caches/node-gyp/15.5.0', gyp info spawn args '-Dnode_gyp_dir=/opt/homebrew/Cellar/node/15.5.0/libexec/lib/node_modules/npm/node_modules/node-gyp', gyp info spawn args '-Dnode_lib_file=/Users/***/Library/Caches/node-gyp/15.5.0/<(target_arch)/node.lib', gyp info spawn args '-Dmodule_root_dir=/***/blog/node_modules/sharp', gyp info spawn args '-Dnode_engine=v8', gyp info spawn args '--depth=.', gyp info spawn args '--no-parallel', gyp info spawn args '--generator-output', gyp info spawn args 'build', gyp info spawn args '-Goutput_dir=.' gyp info spawn args ] gyp info spawn make gyp info spawn args [ 'BUILDTYPE=Release', '-C', 'build' ] CC(target) Release/obj.target/nothing/../node-addon-api/nothing.o LIBTOOL-STATIC Release/nothing.a warning: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/libtool: archive library: Release/nothing.a the table of contents is empty (no object file members in the library define global symbols) TOUCH Release/obj.target/libvips-cpp.stamp CXX(target) Release/obj.target/sharp/src/common.o ../src/common.cc:24:10: fatal error: 'vips/vips8' file not found #include ^~~~~~~~~~~~ 1 error generated. make: *** [Release/obj.target/sharp/src/common.o] Error 1 gyp ERR! build error gyp ERR! stack Error: `make` failed with exit code: 2 gyp ERR! stack at ChildProcess.onExit (/opt/homebrew/Cellar/node/15.5.0/libexec/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:194:23) gyp ERR! stack at ChildProcess.emit (node:events:376:20) gyp ERR! stack at Process.ChildProcess._handle.onexit (node:internal/child_process:284:12) gyp ERR! System Darwin 20.3.0 gyp ERR! command \"/opt/homebrew/Cellar/node/15.5.0/bin/node\" \"/opt/homebrew/Cellar/node/15.5.0/libexec/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js\" \"rebuild\" gyp ERR! cwd /***/blog/node_modules/sharp
What are some alternatives?
jimp - An image processing library written entirely in JavaScript for Node, with zero external or native dependencies.
squoosh - Make images smaller using best-in-class codecs, right in the browser.
gm - GraphicsMagick for node
Next.js - The React Framework
pica - Resize image in browser with high quality and high speed
sveltekit-image-plugin - SvelteKit demo code for using vite-imagetools to add cached, responsive, Next-Gen images to a SvelteKit site with no cumulative layout shift.
imagemin - [Unmaintained] Minify images seamlessly
libvips - A fast image processing library with low memory needs.
lwip - Light Weight Image Processor for NodeJS
node - Node.js JavaScript runtime ✨🐢🚀✨
probe-image-size - Get image size without full download. Supported image types: JPG, GIF, PNG, WebP, BMP, TIFF, SVG, PSD, ICO.
compressorjs - JavaScript image compressor.