Skip to content

Read and write Exif metadata from/into an image 🏷️

License

Notifications You must be signed in to change notification settings

yuanshan/react-native-exify

 
 

Repository files navigation

React Native Exify

CI Maintainability NPM Downloads

A simple library to read and write image Exif metadata in React Native. Inspired from this thread.

Features

  • ✅ Read Exif data from an image
  • ✅ Write Exif data into an image
  • ✅ Tags are typed and standardized
  • ✅ Works with Expo and bare React Native projects

Installation

yarn add @lodev09/react-native-exify

Usage

import { writeAsync, readAsync, ExifTags } from '@lodev09/react-native-exify';

🧐 Reading Exif

// ...
const uri = 'file://path/to/image.jpg'

const tags = await readAsync(uri)
console.log(tags)

✍️ Writing Exif

const uri = 'file://path/to/image.jpg'
const newTags: ExifTags = {
  GPSLatitude: 69.69,
  GPSLongitude: 69.69,
  UserComment: 'Someone wrote GPS here!',
}

const result = await writeAsync(uri, newTags)
console.log(result.tags)

Note

On IOS, writing exif into an Asset file will duplicate the image. IOS does not allow writing exif into an Asset file directly. If you're getting the photo from a camera, write it into the output file first before saving to the Asset library!

See example for more detailed usage.

Contributing

Contributions are welcome!

See the contributing guide to learn how to contribute to the repository and the development workflow.

About

Read and write Exif metadata from/into an image 🏷️

Resources

License

Code of conduct

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Kotlin 32.1%
  • TypeScript 32.1%
  • Swift 22.2%
  • JavaScript 5.6%
  • Ruby 4.2%
  • Objective-C++ 1.8%
  • Other 2.0%