Code Monkey home page Code Monkey logo

react-native-heic-converter's People

Contributors

dependabot[bot] avatar floydkim avatar gustavoggs avatar maxim-kolesnikov avatar psiiirus avatar tendolukwago avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

react-native-heic-converter's Issues

Performance overview?

Is there any data/benchmarks on the performance of this library on different platforms, or even a rough estimate to its temporal/computational/memory cost?

Cannot read property 'convert' of undefined

Hello, im trying to use this module to convert an HEIC image to any other format, ideally jpeg.

Possible Unhandled Promise Rejection (id: 0):
TypeError: Cannot read property 'convert' of undefined
TypeError: Cannot read property 'convert' of undefined
    at Function.convert (blob:file:///2c18ee93-d65c-4c25-b452-893bcc1f69b1:186035:31)
    at _callee3$ (blob:file:///2c18ee93-d65c-4c25-b452-893bcc1f69b1:183934:61)
    at tryCatch (blob:file:///2c18ee93-d65c-4c25-b452-893bcc1f69b1:24992:19)
    at Generator.invoke [as _invoke] (blob:file:///2c18ee93-d65c-4c25-b452-893bcc1f69b1:25165:24)
    at Generator.prototype.(anonymous function) [as next] (blob:file:///2c18ee93-d65c-4c25-b452-893bcc1f69b1:25035:23)
    at tryCatch (blob:file:///2c18ee93-d65c-4c25-b452-893bcc1f69b1:24992:19)
    at invoke (blob:file:///2c18ee93-d65c-4c25-b452-893bcc1f69b1:25068:22)
    at blob:file:///2c18ee93-d65c-4c25-b452-893bcc1f69b1:25078:15
    at tryCallOne (blob:file:///2c18ee93-d65c-4c25-b452-893bcc1f69b1:8683:14)
    at blob:file:///2c18ee93-d65c-4c25-b452-893bcc1f69b1:8784:17

However, I get the error above when I run the code below:

RNHeicConverter
    .convert({
        path: img.uri,
    })
    .then((result) => {
        console.log(result);
    });

where I import RNHeicConverter as required.

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

I have successfully linked RNHeicConverter and I am not seeing errors, this is joining a pretty beefy React-Native project and when I actually log RNHeicConverter to ensure it is functioning as intended it logs:

function HEICConverter() {
      _classCallCheck(this, HEICConverter);
    }

so it certainly doesn't look undefined


I think this is happening because of how it pulls RNHeicConverter from nativeModules in your index.js

import { NativeModules } from 'react-native';

const { RNHeicConverter } = NativeModules;

Any thoughts on what the fix may be?
Thankyou!

assets-library uri not matching .heic extension check, invalid for newJpgPath

When using react-native-image-picker, the uri to pass to the heic converter contains an assets-library:// uri which doesn't pass the .heic pathExtension check, and isn't valid to be with the newJpgPath.

Example path: assets-library://asset/asset.HEIC?id=CE542E92-B1FF-42DC-BD89-D61BB70EB4BF&ext=HEIC

Is there a better alternative than the react-native-image-picker?

Example output from react-native-image-picker

{
  "fileName": "IMG_5382.HEIC",
  "fileSize": 11907893,
  "height": 3024,
  "isVertical": false,
  "latitude": 45,
  "longitude": 123,
  "origURL": "assets-library://asset/asset.HEIC?id=CE542E92-B1FF-42DC-BD89-D61BB70EB4BF&ext=HEIC",
  "timestamp": "2018-05-09T12:41:26Z",
  "uri": "file:///Users/USERNAME/Library/Developer/CoreSimulator/Devices/########-####-####-####-############/data/Containers/Data/Application/########-####-####-####-############/Documents/########-####-####-####-############.jpg",
  "width": 4032
}

Please i get this error !!! [TypeError: null is not an object (evaluating 'RNHeicConverter.convert')]

Am trying to convert an HEIC file from two places.

From @react-native-cameraroll and from react-native-image-crop-picker

Used RNHeicConverter.convert() am not getting any result neither am i getting a response.

`
const sendFile = async () => {

try {
  const res = await ImagePicker.openPicker({
    cropping: false,
    mediaType: 'photo',
    forceJpg: true,
  });

  RNHeicConverter.convert({path: res?.sourceURL}) 
    .then((res: any) => console.log(res))
    .catch((err: any) => console.log(err));

  if (res) {
    const file = {
      uri:
        Platform.OS === 'android'
          ? res?.path
          : res?.sourceURL,
      type: res?.mime,
      name:
        Platform.OS === 'android' ? Date.now().toString() : res?.filename,
    };

    // await postImage(file);
  }
} catch (error) {
  // console.log('file picker catch error', error);

}

};
`

Please i need help ๐Ÿ™๐Ÿฝ

'React/RCTDefines.h' file not found

Hiya,
i just updated a project from 59 to 61 and it breaks with this message:

'React/RCTDefines.h' file not found

In file included from /Users/tonigurski/_Entwicklung/react-native/snazz/node_modules/react-native-heic-converter/ios/RNHeicConverter.m:2:
In file included from /Users/tonigurski/_Entwicklung/react-native/snazz/node_modules/react-native-heic-converter/ios/RNHeicConverter.h:3:
../../react-native/React/Base/RCTBridgeModule.h:10:9: fatal error: 'React/RCTDefines.h' file not found
#import <React/RCTDefines.h>
        ^~~~~~~~~~~~~~~~~~~~
1 error generated.

Any idea how to fix this?!

Cheers!

it fails to compile on android

the promise convert is not recognized as promise and cause issues when trying to build the app, my app runs in both platforms fine but for android I have to manually remove the await and async in order to be compiled and built

File Permissions Error

I'm attempting to convert an HEIC file that I'm sharing to my app from iMessage. I only recently became aware of this file format and as far as I know, old iMessage images are the only source of HEIC files on one's iPhone. When I attempt to convert the file using this library, I receive the following permissions error.

iOS: 11.3.1
RN: 0.55.3

img

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.