Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

is-png

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

is-png - npm Package Compare versions

Comparing version 1.0.0 to 1.1.0

license

8

index.js
'use strict';
module.exports = function (buf) {
if (!buf || buf.length < 4) {
if (!buf || buf.length < 8) {
return false;

@@ -10,3 +10,7 @@ }

buf[2] === 78 &&
buf[3] === 71;
buf[3] === 71 &&
buf[4] === 13 &&
buf[5] === 10 &&
buf[6] === 26 &&
buf[7] === 10;
};
{
"name": "is-png",
"version": "1.0.0",
"version": "1.1.0",
"description": "Check if a Buffer/Uint8Array is a PNG image",

@@ -5,0 +5,0 @@ "license": "MIT",

@@ -22,3 +22,3 @@ # is-png [![Build Status](https://travis-ci.org/sindresorhus/is-png.svg?branch=master)](https://travis-ci.org/sindresorhus/is-png)

var isPng = require('is-png');
var buffer = readChunk.sync('unicorn.png', 0, 4);
var buffer = readChunk.sync('unicorn.png', 0, 8);

@@ -51,3 +51,3 @@ isPng(buffer);

It only needs the first 4 bytes.
It only needs the first 8 bytes.

@@ -54,0 +54,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