-
Notifications
You must be signed in to change notification settings - Fork 74
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
How to get size of tinified images #26
Comments
@theahmadzai the API returns both the input size (before compression) and output size (after compression), but in the nodejs library we currently don't have a function available to get the input size. Feel free to add it and provide a pull request. You can refer to the documentation on https://tinypng.com/developers/reference for the API calls available via HTTP. We do have a function available in the nodejs library to get the size of the compressed image. A simple example of printing it is
To get the size before compression it might be easiest to use the filesystem module within nodejs. |
Thanks, I'm tinkering with the library. {
"input": {
"size": 207565,
"type": "image/jpeg"
}
} while uploading from URL returns {
"output": {
"size": 30734,
"type": "image/png"
}
} |
@theahmadzai it looks like the documentation on https://tinypng.com/developers/reference isn't complete in regards to the json returned for some API calls. If you give any of those curl commands a try you will see that for both upload from file and url return a response including both input and output, like:
|
How to get metadata of images, size before and after tinification are there any methods available on node.js API, I'm sorry I searched a lot but couldn't find useful resources. If anyone could help?
The text was updated successfully, but these errors were encountered: