react-native-image-resizer icon indicating copy to clipboard operation
react-native-image-resizer copied to clipboard

Arithmetic Exception - divide by zero

Open jahicDario opened this issue 6 years ago • 4 comments

I am getting this error when I try to resize image on Samsung S6 and S6 edge. Screenshot_20190715-142051

jahicDario avatar Jul 15 '19 13:07 jahicDario

me too

bneigher avatar Jul 25 '19 19:07 bneigher

@jahicDario Do you know if this also happens on most recent samsung (S8/S9/S10) ?

PierreCapo avatar Oct 27 '19 09:10 PierreCapo

Any updates in here?

abo-rythm avatar Jul 06 '21 15:07 abo-rythm

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) => {

abo-rythm avatar Oct 05 '21 05:10 abo-rythm

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.

stale[bot] avatar Sep 01 '22 18:09 stale[bot]

This issue has been automatically closed. Thank you for your contributions.

stale[bot] avatar Sep 08 '22 18:09 stale[bot]