react-native-image-resizer
react-native-image-resizer copied to clipboard
Arithmetic Exception - divide by zero
I am getting this error when I try to resize image on Samsung S6 and S6 edge.

me too
@jahicDario Do you know if this also happens on most recent samsung (S8/S9/S10) ?
Any updates in here?
This happens because when you get the photos using CameraRoll or another library, you specifically have to include imageSize and get the width and height in the result. I'm using the libraries like this:
CameraRoll.getPhotos({ first: 100, include: ['imageSize'] }) .then((photo: PhotoIdentifiersPage) => { if (isLoading) { setIsLoading(false); } let imagesMap: IGalleryImage[] = []; photo.edges.map((edge: PhotoIdentifier, index: number) => { imagesMap = [ ...imagesMap, edge.node.image]; });
ImageResizer.createResizedImage( item.uri, item.width - IMAGE_SHRINK_VALUE, item.height - IMAGE_SHRINK_VALUE, 'JPEG', 50 ) .then((response) => {
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
This issue has been automatically closed. Thank you for your contributions.