Comments (2)
Did you see the resolveWithObject
property of toBuffer()
?
https://sharp.pixelplumbing.com/api-output#tobuffer
const { data, info } = await sharp(input).trim().toBuffer({ resolveWithObject: true });
const { trimOffsetLeft, trimOffsetTop } = info;
from sharp.
Thank your for the answer. I did not realize this would include the info object from .trim()
. This now works.
from sharp.
Related Issues (20)
- Install on Heroku: cannot find glib-object.h HOT 2
- Unable to read HEIC file HOT 15
- GIF Image metadata error
- Support win on arm64 HOT 1
- sharp not included in a packaged Electron app build with Quasar (yarn 4.3.1, electron-builder, vite)
- Cannot install Sharp Android HOT 3
- rewrite existing file with buffer and fs responds with errno: -4094, code: 'UNKNOWN', syscall: 'open', HOT 1
- sharp was working fine but doesn't anymore HOT 3
- Installing for x64 on Mac M1 only installs arm64 despite cross-platform options HOT 3
- Video filter option to skip frames or set maximum time to read from input HOT 2
- Could not load the "sharp" module using the linuxmusl-x64 runtime in docker HOT 1
- Enhancement: add/update XMP and IPTC metadata HOT 2
- Proposal: opt-in mode to pre-orient images HOT 2
- Enhancement: add support to recomb for 4x4 recombination matrices HOT 1
- Error: Could not load the "sharp" module using the linuxmusl-x64 runtime HOT 1
- Trim cuts off top of my image HOT 4
- Error VipsJpeg Corrupt JPEG data from CCTV Image Snapshot HOT 2
- We set `SHARP_FORCE_GLOBAL_LIBVIPS`, but it's still including its own header files. HOT 4
- Support for bun runtime #2 HOT 4
- toFormat("jxl") throws an error HOT 2
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.