1.3.2 • Published 1 year ago

react-native-heic-converter v1.3.2

Weekly downloads
2,127
License
MIT
Repository
github
Last release
1 year ago

react-native-heic-converter

npm version npm MIT Platform - iOS issues

Contribution

Issues are welcome. Please add a code snippet. Quickest way to solve issue is to reproduce it on one of the examples in DEMO.

Pull requests are welcome. If you want to change API or making something big better to create issue and discuss it first. Before submiting PR please run eslint . Also all eslint fixes are welcome.

Getting started

$ npm install react-native-heic-converter --save

Features

  • Returns the data for the specified image in JPEG format.
  • Returns the data for the specified image in PNG format.
  • Returns the data for the encoded image in base64 format.
  • Value of compression quality
  • Support representation of an image in the Photos library.

Mostly automatic installation

$ react-native link react-native-heic-converter

Manual installation

Add the following lines to your build targets in your Podfile

pod 'react-native-heic-converter', :path => '../node_modules/react-native-heic-converter'

Then run pod install

  1. In XCode, in the project navigator, right click LibrariesAdd Files to [your project's name]
  2. Go to node_modulesreact-native-heic-converter and add RNHeicConverter.xcodeproj
  3. In XCode, in the project navigator, select your project. Add libRNHeicConverter.a to your project's Build PhasesLink Binary With Libraries
  4. Run your project (Cmd+R)<

Static Methods

RNHeicConverter.convert(options{}).then(result{})

Options

PropertyTypeDefaultDescription
pathstringPath to your .HEIC file
qualitynumber1Set quality 0 to 1, for jpg extension only
extensionstringjpgFile extension that you want get when convert: jpg or png or base64

Usage

import RNHeicConverter from 'react-native-heic-converter';

RNHeicConverter
	.convert({ // options
		path: '/path/to/file.heic',
	})
	.then((result) => {
		console.log(result); // { success: true, path: "path/to/jpg", error, base64, }
	});

Please have a look at my example usage.

CHANGELOG