maxim-kolesnikov / react-native-heic-converter Goto Github PK
View Code? Open in Web Editor NEWConvert your HEIC files with React Native
License: MIT License
Convert your HEIC files with React Native
License: MIT License
This commit is not included in release 1.3.1
I could not resolve react native windows because of the npm peer dependency error.
Please release with this commit.
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?
hello the library returns this error:
FAILURE [TypeError: null is not an object (evaluating 'RNHeicConverter.convert')]
could you give me support?
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!
Hi, since Android 10+ can view and save HEIC file formats, I'd like to ask if you're interested supporting Android as well?
https://github.com/jordond/HEIF-converter
Would you consider adding this or accept PRs?
It would be great if the library preserves metadata.
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
}
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 ๐๐ฝ
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!
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
Node shows the latest built version as 1.3.0.. when you have the latest tagged release at 1.3.1
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
Good morning,
i was wondering if you(@maxim-kolesnikov) going to update this repo to RN60?
Cheers,
Toni
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.