Socket
Socket
Sign inDemoInstall

is-jpg

Package Overview
Dependencies
0
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 0.1.0 to 0.1.1

5

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

@@ -9,4 +9,3 @@ }

buf[1] === 216 &&
buf[2] === 255 &&
(buf[3] === 224 || buf[3] === 225);
buf[2] === 255;
};

2

package.json
{
"name": "is-jpg",
"version": "0.1.0",
"version": "0.1.1",
"description": "Check if a Buffer/Uint8Array is a JPEG image",

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

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

var isJpg = require('is-jpg');
var buffer = readChunk('unicorn.jpg', 0, 4);
var buffer = readChunk('unicorn.jpg', 0, 3);

@@ -59,3 +59,3 @@ isJpg(buffer);

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

@@ -62,0 +62,0 @@

SocketSocket SOC 2 Logo

Product

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc