Introducing Socket Firewall: Free, Proactive Protection for Your Software Supply Chain.Learn More
Socket
Book a DemoInstallSign in
Socket

@idot-digital/image-convert-lib

Package Overview
Dependencies
Maintainers
2
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@idot-digital/image-convert-lib

Libary for image converion with iDot apis!

latest
npmnpm
Version
1.2.6
Version published
Maintainers
2
Created
Source

Image Conversion Library

Mit dieser Library kann man Bilder komprimieren, skallieren und in neue Formate umwandeln.

Supportete Input Formate:

  • JPG/JPEG
  • PNG
  • TIFF
  • WEBP
  • GIF

Supportete Output Formate:

  • JPG/JPEG
  • WEBP
  • JP2

Benutzung Zur Benutzung wird ein APIKey benötigt, bitte wenden Sie sich hierzu an die Geschäftsführung von iDot digital.

const IMAGE = await fs.readFile("./image.png");

const ic = new ImageConverter("putAPIKeyHere");

const CONPRESSED_IMAGE = await ic.imgToWEBP(JPEG, 1000);

await fs.writeFile("./image.webp", CONPRESSED_IMAGE);

Es stehen follgende Funktionen zur Verfügung:

  • imgToWEBP(buffer, width)
  • imgToJPG(buffer, width)
  • pngToJPG(buffer, width)
  • imgToJP2(buffer, width, convertioApiKey)

pngToJPG(buffer, width) ist dabei bei PNG Bildern vorzuziehen, da es kleinere Dateien generiert.

Bei imgToJP2() wird der Service Convertio genutzt wird, daher muss ein zusätzlicher ApiKey angegeben werden.

FAQs

Package last updated on 04 May 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts