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

image-convert

Package Overview
Dependencies
Maintainers
1
Versions
28
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

image-convert - npm Package Compare versions

Comparing version 0.1.305 to 0.1.306

14

index.js

@@ -6,4 +6,12 @@ // Copyright 2016 Arshpreet Wadehra

const request = require('request').defaults({ encoding: null });
const base64 = require('file-base64');
const atob = require('atob');
function dataURLtoFile(dataurl, filename) {
var arr = dataurl.split(','), mime = arr[0].match(/:(.*?);/)[1],
bstr = atob(arr[1]), n = bstr.length, u8arr = new Uint8Array(n);
while(n--){
u8arr[n] = bstr.charCodeAt(n);
}
return new File([u8arr], filename, {type:mime});
}
module.exports = {

@@ -26,5 +34,3 @@ fromURL : (options, callback)=>{

buffer = image(body).size(size).encode(output_format,{quality:quality});
base64.decode(buffer,new Date()+"az."+output_format,function(err,out){
callback(null,out);
})
callback(null,dataURLtoFile(buffer,new Date()+"."+output_format));
});

@@ -31,0 +37,0 @@ }

{
"name": "image-convert",
"version": "0.1.305",
"version": "0.1.306",
"description": "convert image to different format like gif2jpg jpg2png also manage the quality & size",

@@ -25,3 +25,3 @@ "main": "index.js",

"dependencies": {
"file-base64": "^1.0.0",
"atob": "^2.0.3",
"images": "^3.0.0",

@@ -28,0 +28,0 @@ "request": "^2.79.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