![PyPI Now Supports iOS and Android Wheels for Mobile Python Development](https://cdn.sanity.io/images/cgdhsj6q/production/96416c872705517a6a65ad9646ce3e7caef623a0-1024x1024.webp?w=400&fit=max&auto=format)
Security News
PyPI Now Supports iOS and Android Wheels for Mobile Python Development
PyPI now supports iOS and Android wheels, making it easier for Python developers to distribute mobile packages.
A JavaScript library to use ICO. Works on both Node.js and the browser.
NOTE: This package is a fork of parse-ico.
npm install parse-ico
const ICO = require('parse-ico');
const ICO = require('parse-ico/browser')
or
<script type="text/javascript" src="node_modules/parse-ico/dist/ico.js"></script>
To fully use this library, browsers must support JavaScript typed arrays, Canvas API and Promise. Chrome, Edge 12, Firefox and Safari 9 support these functions.
const fs = require('fs');
const ICO = require('parse-ico');
const buffer = fs.readFileSync('favicon.ico');
ICO.parse(buffer, 'image/png').then(images => {
// save as png files
images.forEach(image => {
const file = `${image.width}x${image.height}-${image.bpp}bit.png`;
const data = Buffer.from(image.buffer);
fs.writeFileSync(file, data);
});
});
<input type="file" id="input-file" />
<script>
document.getElementById('input-file').addEventListener('change', function (evt) {
// use FileReader for converting File object to ArrayBuffer object
var reader = new FileReader();
reader.onload = function (e) {
ICO.parse(e.target.result).then(function (images) {
// logs images
console.dir(images);
})
};
reader.readAsArrayBuffer(evt.target.files[0]);
}, false);
</script>
boolean
⏏Promise.<Array.<ParsedImage>>
⏏boolean
⏏Check the ArrayBuffer is valid ICO.
Kind: global method of ICO
Returns: boolean
- True if arg is ICO.
Param | Type | Description |
---|---|---|
source | ArrayBuffer | Buffer | ICO file data. |
Promise.<Array.<ParsedImage>>
⏏Parse ICO and return some images.
Kind: global method of ICO
Returns: Promise.<Array.<ParsedImage>>
- Resolves to an array of ParsedImage.
Param | Type | Default | Description |
---|---|---|---|
buffer | ArrayBuffer | Buffer | ICO file data. | |
[mime] | string | "image/png" | MIME type for output. |
object
Kind: global typedef
Properties
Name | Type | Description |
---|---|---|
width | number | Image width. |
height | number | Image height. |
bpp | number | Image color depth as bits per pixel. |
buffer | ArrayBuffer | Image buffer. |
MIT license
FAQs
parse ico files and convert .pngs to .ico files
The npm package parse-ico receives a total of 0 weekly downloads. As such, parse-ico popularity was classified as not popular.
We found that parse-ico demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
PyPI now supports iOS and Android wheels, making it easier for Python developers to distribute mobile packages.
Security News
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.