Socket
Socket
Sign inDemoInstall

to-ico

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

to-ico - npm Package Compare versions

Comparing version 1.1.3 to 1.1.4

11

index.js
'use strict';
const arrify = require('arrify');
const bufferAllocMod = require('buffer-alloc');
const imageSize = require('image-size');

@@ -14,4 +15,6 @@ const parsePng = require('parse-png');

const bufferAlloc = typeof Buffer.alloc === 'function' ? Buffer.alloc : bufferAllocMod;
const createHeader = n => {
const buf = Buffer.alloc(constants.headerSize);
const buf = bufferAlloc(constants.headerSize);

@@ -26,3 +29,3 @@ buf.writeUInt16LE(0, 0);

const createDirectory = (data, offset) => {
const buf = Buffer.alloc(constants.directorySize);
const buf = bufferAlloc(constants.directorySize);
const size = data.data.length + constants.bitmapSize;

@@ -46,3 +49,3 @@ const width = data.width === 256 ? 0 : data.width;

const createBitmap = (data, compression) => {
const buf = Buffer.alloc(constants.bitmapSize);
const buf = bufferAlloc(constants.bitmapSize);

@@ -68,3 +71,3 @@ buf.writeUInt32LE(constants.bitmapSize, 0);

const end = rows - cols;
const buf = Buffer.alloc(data.length);
const buf = bufferAlloc(data.length);

@@ -71,0 +74,0 @@ for (let row = 0; row < rows; row += cols) {

{
"name": "to-ico",
"version": "1.1.3",
"version": "1.1.4",
"description": "Convert PNG to ICO in memory",

@@ -30,3 +30,3 @@ "license": "MIT",

"arrify": "^1.0.1",
"icojs": "^0.4.1",
"buffer-alloc": "^1.1.0",
"image-size": "^0.5.0",

@@ -38,9 +38,7 @@ "parse-png": "^1.0.0",

"ava": "*",
"file-type": "^3.8.0",
"file-type": "^4.3.0",
"icojs": "^0.7.2",
"pify": "^2.3.0",
"xo": "*"
},
"xo": {
"esnext": true
}
}

@@ -38,4 +38,6 @@ # to-ico [![Build Status](https://travis-ci.org/kevva/to-ico.svg?branch=master)](https://travis-ci.org/kevva/to-ico)

An array of PNG image buffers.
Array of PNG image buffers.
The images must have a size of `16x16`, `24x24`, `32x32`, `48x48`, `64x64`, `128x128` or `256x256` and they must have an 8 bit per sample (channel) bit-depth (on Unix you can check this with the `file` command: RGB(A) is supported, while [colormap](https://en.wikipedia.org/wiki/Indexed_color) is not, because it's 8 bits per pixel instead of 8 bits per channel, which is 24 or 32 bits per pixel depending on the presence of the alpha channel). These are limitations in the underlying [`pngjs`](https://github.com/lukeapage/pngjs#pngjs) library. If you have a colormap PNG you can convert it to an RGB/RGBA PNG with commonly used image editing tools.
#### options

@@ -42,0 +44,0 @@

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc