Comparing version 1.0.0 to 1.1.0
'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 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Trivial Package
Supply chain riskPackages less than 10 lines of code are easily copied into your own project and may not warrant the additional supply chain risk of an external dependency.
Found 1 instance in 1 package
3056
4
14
0