New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

heic2any

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

heic2any

Converting HEIC/HEIF to PNG/JPEG/GIF in the browser

  • 0.0.4
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
28K
decreased by-76.77%
Maintainers
1
Weekly downloads
 
Created

What is heic2any?

The heic2any npm package is a JavaScript library that allows you to convert HEIC (High Efficiency Image Coding) images to other formats such as JPEG, PNG, and GIF. It is particularly useful for web applications that need to handle HEIC images, which are commonly used by Apple devices.

What are heic2any's main functionalities?

Convert HEIC to JPEG

This code sample demonstrates how to convert a HEIC file to a JPEG file using the heic2any package. It listens for a file input change event, converts the selected HEIC file to JPEG, and then displays the converted image on the webpage.

const heic2any = require('heic2any');

const inputFile = document.getElementById('inputFile');
inputFile.addEventListener('change', async (event) => {
  const file = event.target.files[0];
  const convertedBlob = await heic2any({ blob: file, toType: 'image/jpeg' });
  const img = document.createElement('img');
  img.src = URL.createObjectURL(convertedBlob);
  document.body.appendChild(img);
});

Convert HEIC to PNG

This code sample demonstrates how to convert a HEIC file to a PNG file using the heic2any package. It listens for a file input change event, converts the selected HEIC file to PNG, and then displays the converted image on the webpage.

const heic2any = require('heic2any');

const inputFile = document.getElementById('inputFile');
inputFile.addEventListener('change', async (event) => {
  const file = event.target.files[0];
  const convertedBlob = await heic2any({ blob: file, toType: 'image/png' });
  const img = document.createElement('img');
  img.src = URL.createObjectURL(convertedBlob);
  document.body.appendChild(img);
});

Convert HEIC to GIF

This code sample demonstrates how to convert a HEIC file to a GIF file using the heic2any package. It listens for a file input change event, converts the selected HEIC file to GIF, and then displays the converted image on the webpage.

const heic2any = require('heic2any');

const inputFile = document.getElementById('inputFile');
inputFile.addEventListener('change', async (event) => {
  const file = event.target.files[0];
  const convertedBlob = await heic2any({ blob: file, toType: 'image/gif' });
  const img = document.createElement('img');
  img.src = URL.createObjectURL(convertedBlob);
  document.body.appendChild(img);
});

Other packages similar to heic2any

Keywords

FAQs

Package last updated on 29 Mar 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

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