1.0.4-beta.0 • Published 21 days ago

react-native-image-file-transformer v1.0.4-beta.0

Weekly downloads
-
License
MIT
Repository
github
Last release
21 days ago

React Bative Image File Transformer

convert, compress, scale any animated or static image

image-removebg-preview1-ezgif com-resize (3)

npm version

react-native-image-file-transformer is a React Native module that provides functionality for transforming and manipulating image files.

Platform support:

  • Android
  • ios

Installation

npm install react-native-image-file-transformer

Usage

Import:

import { Transform } from 'react-native-image-file-transformer';

Operations:

await Transform.static([uri2, uri2,... ], options);
await Transform.animated([uri1, uri2,... ], options);

Constants:

ScaleMode:
Transform.ScaleMode.CROP
Transform.ScaleMode.STRETCH
Transform.ScaleMode.FIT_CENTER

FormatType:
Transform.FormatType.JPEG
Transform.FormatType.PNG
Transform.FormatType.WEBP
Transform.FormatType.GIF
Transform.FormatType.AWEBP
Transform.FormatType.UNKNOWN
 

Misc:

await Transform.getImageType([uri1, uri2, ...])

// Output
//[{"extention": "png", "isAnimated": false, "type": "PNG_A", "uri": "/storage/emulated/..."}] 
await Transform.clearCache()

Example:

Transform.animated(uris, { 
  width:100, // default will be taken from image
  height:100, // default will be taken from image
  quality:70,  // default 100
  scaleMode:Transform.ScaleMode.FIT_CENTER, // default FIT_CENTER
  targetFormat:Transform.FormatType.AWEBP, // default JPGE/GIF
//   minDelay:80, (ms)
//   maxDelay:1000, (ms)
//   parentDir:"storage/emulated/0/Download/output"
})
.then(r=>{log(r)})
.catch(e=>{log('error ',e)})

Contribution

If you find any issues or have suggestions for improvements, please open an issue or submit a pull request on the project's GitHub repository. CONTRIBUTING.md

Contact on:

X (twitter) : x.com/heyKSR

License

LICENSE

1.0.4-beta.0

21 days ago

1.0.2-beta.0

21 days ago

1.0.1-beta.0

22 days ago

1.3.0-alpha.0

22 days ago

1.2.8-alpha.0

23 days ago

1.2.9-alpha.0

22 days ago

1.0.6-alpha.0

24 days ago

1.0.8-alpha.0

24 days ago

1.0.7-alpha.0

24 days ago

1.0.5-alpha.0

3 months ago

1.0.4-alpha.0

3 months ago

1.0.3-alpha.0

3 months ago

1.0.2-alpha.0

3 months ago

1.0.1-alpha.0

3 months ago

1.0.6-beta.1

3 months ago

1.0.3-alpha.2

3 months ago

1.0.2-alpha.2

3 months ago

1.0.1-alpha.2

3 months ago

1.0.0-alpha.2

3 months ago

1.0.0-alpha.1

3 months ago

1.0.0-alpha.0

3 months ago