Last updated:
0 purchases
metadata
metadata #
metadata is a dart library to extract exif data of the images.
Support ❤️❤️ #
Thanks for being kind and hitting the support button. Much Appreciated 🙌!!
Table of Contents #
Installing
Usage
Imports
Read image file
Read image file from Asset Folder
Extract Exif Data
Extract Exif Data with callback
Saving Exif Content into File
Upcoming Features
Donate (Be the First one)
Lets Get Started #
1. Depend on it #
Add this to your package's pubspec.yaml file:
dependencies:
metadata: any
copied to clipboard
2. Install it #
You can install packages from the command line:
with pub:
$ pub get
copied to clipboard
3. Import it #
Now in your Dart code, you can use:
import 'package:metadata/metadata.dart';
copied to clipboard
Usage #
Imports #
import 'package:metadata/metadata.dart';
copied to clipboard
Read Image File #
var file = "path_to_pre_existing_image_file/image.jpg";
var bytes = File(file).readAsBytesSync();
copied to clipboard
Read Image from Flutter's Asset Folder #
import 'package:flutter/services.dart' show ByteData, rootBundle;
/* Your awesome code here */
ByteData data = await rootBundle.load("assets/path_to_pre_existing_image_file/image.jpg";);
var bytes = data.buffer.asUint8List(data.offsetInBytes, data.lengthInBytes);
copied to clipboard
Extract Exif Data #
var result = MetaData.exifData(bytes);
if (result.error == null) {
var content = result.exifData; // exif data is available in contents
saveFile(image_name, content);
} else {
print('File: $image.jpg, Error: ${result.error}');
}
copied to clipboard
Extract Exif Data with callback #
MetaData.exifData(bytes, onValue: (CallBack result) {
if (result.error == null) {
var content = result.exifData;
saveFile(image_name, content);
} else {
print('File: $image.jpg, Error: ${result.error}');
}
});
copied to clipboard
Extract XMP Data #
var mapResult = MetaData.extractXMP(bytes);
print(mapResult.toString());
saveFile(image_name, mapResult);
copied to clipboard
Saving exif content into File #
void saveFile(String fileName, dynamic exifContent) {
File('${path}$fileName.json').writeAsStringSync(jsonEncode(exifContent));
}
copied to clipboard
For personal and professional use. You cannot resell or redistribute these repositories in their original state.
There are no reviews.