Converting a PNG file to an ICO file with multiple sizes
How would I go about Converting a PNG file to an ICO file with multiple sizes(node js) along with a manifest
-
Hi Nick,
Thank you for reaching out.
Could you please clarify what you mean by manifest in this context? Do you simply need a file with the various sizes of the image? Or are you trying to generate a set of breakpoints described here?
Either way, to convert an image to ICO, you can simply set the height and width parameter along with the `.ico` extension e.g. https://res.cloudinary.com/demo/image/upload/w_32,h_32/sample.ico
If you want to do this programmatically then you can specify the various sizes using our eager upload feature described here.
e.g.cloudinary.v2.uploader
.upload("sample.jpg",
{ eager: [
{ width: 16, height: 16, format: "ico" },
{ width: 32, height: 32, format: "ico" }, ]})
.then(result=>console.log(result));
The above will then create the below eagerly:You can also perform the same operation on existing assets using the explicit API (https://cloudinary.com/documentation/image_upload_api_reference#explicit)
Please note the dimensions should be small and within accepted limits of ICO or else your transformation may fail.
Please let me know if you have any other questions or queries.
Kind Regards,
Thomas
Post is closed for comments.
Comments
2 comments