how to get metadata of output image?
See original GitHub issuethe current example only get input image metadata, not output, if the input image’s size is 1200x1200, we get {width: 1200, height: 1200, ...}
not {width: 400, height: ?, ...}
const sharpInstance = sharp(buf).resize(400);
const resizedBuf = await sharpInstance.toBuffer();
const metadata = await sharpInstance.metadata();
Issue Analytics
- State:
- Created 6 years ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
How to read and export image metadata with Exiftool
Once installed in your operating system of choice, you will have the ability to use the command line to quickly view and export...
Read more >Extract Image Metadata with JSON Output Format
Extract Image Metadata with JSON Output Format ... Metadata is a powerful tool when working with images. It can tell you the dimensions...
Read more >How to extract image metadata in Python? - GeeksforGeeks
Approach: Import the pillow module. Load the image; Get the metadata. The metadata so obtained; Convert it into human-readable form.
Read more >How to Obtain Valuable Data from Images Using Exif Extractors
To view Exif information, upload a file or add its public URL, then hit “View Exif.” In my example, passing the same photo...
Read more >How To View Image Metadata On Linux - OSTechNix
ImageMagick has a command line tool named "Identify" to find image metadata. ImageMagick is available in the default repositories of most Linux ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Can this be achieved without calling toBuffer? It seems like a common use-case that somebody would need to know the metadata of the transformed file.
@lovell Eg, I want to convert an unknown sized image to 200*100 with { fit: inside }. after resize call, the size of processed image is unknown, I need to calculate paddings and call extend to extend the image to 200*100.
I don’t know if it is a bug. After
I got an 100*100 image when input is square.