Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(android): return and store exif data in blob/file #14074

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

m1ga
Copy link
Contributor

@m1ga m1ga commented Jul 2, 2024

Two new features:

  • get exif data in event.media.exif from the camera media file
  • it will also be store into a file when you run imageAsCompressed and write that blob data
var win = Ti.UI.createWindow();

win.addEventListener("click", function() {
	Ti.Media.showCamera({
		success: function(event) {
			console.log(event.media.exif)

			var f = Titanium.Filesystem.getFile(Titanium.Filesystem.applicationDataDirectory + "/image.jpg");
			f.write(event.media);

			var f1 = Titanium.Filesystem.getFile(Titanium.Filesystem.applicationDataDirectory + "/image1.jpg");
			f1.write(event.media.imageAsCompressed(0.9));
		}
	});
})

win.open();

Test
12.3.1:

  • run the above code in Ti 12.3.1 and download the two files from your phone
  • image1.jpg won't have any exif data

With this PR:

  • image1.jpg will have exif data
  • you will see a console.log with the exif data from the camera image

TODO

  • docs
  • test it a bit more and check other imageAs... methods

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant