Exiv2 in Chrome extension
Added by Benjamin H. over 7 years ago
We built a Chrome extension that uses exiv2 via Native Client for reading metadata.
The extension will be published later. Some additional fixes and git cleaning is needed.
However, maybe someone likes to use exiv2 this way. You can use exiv2 from Javascript
via a wrapper binary that uses the library. You can build the lib for Native Client via naclports.
For this you need the additional files from https://github.com/bhenne/naclports-exiv.
Replies (12)
RE: Exiv2 in Chrome extension - Added by Benjamin H. over 7 years ago
Sorry, just renamed the github repo: https://github.com/bhenne/naclports-exiv2
RE: Exiv2 in Chrome extension - Added by Robin Mills over 7 years ago
Thanks for posting this, Benjamin. I'm sure this is very useful contribution that extends the reach of the library. Thanks for doing this, and for sharing your work for use by others.
Robin
RE: Exiv2 in Chrome extension - Added by Benjamin H. over 7 years ago
I just shared the code of the Chrome extension that uses exiv2 via native client: https://github.com/bhenne/ChromeExtension-PhotoMetadataPrivacy/
RE: Exiv2 in Chrome extension - Added by Robin Mills over 7 years ago
Thanks for sharing this. I'll build this and give you some feedback.
Robin
RE: Exiv2 in Chrome extension - Added by Robin Mills over 7 years ago
I'm stuck. Please help. I'm building on the Mac, however I don't believe differences between Linux and Mac are the issue.
801 rmills@rmills-mbp:~/dev/naclports/src $ make exiv2 build_tools/naclports.py install exiv2 naclports: $NACL_SDK_ROOT does not exist: /Users/rmills/dev/nacl_sdk/pepper_33 make: *** [exiv2] Error 1 802 rmills@rmills-mbp:~/dev/naclports/src $
I'm also puzzled by the instruction:
Besides interpreted Javascript code this Chrome extension uses a native client app that includes the exiv2 C++ library. You have to build that and place it in bin/ before deploying the extension.
What is "it" ? The dynamic library, the exiv2 executable program or something else?
RE: Exiv2 in Chrome extension - Added by Benjamin H. over 7 years ago
See updated https://github.com/bhenne/ChromeExtension-PhotoMetadataPrivacy/blob/master/INSTALL for error handling.
SDK version changed from pepper33 to pepper35. Additionally, naclports package file syntax slightly changed.
I will update the other files later.
It = the native client executables *.nexe
RE: Exiv2 in Chrome extension - Added by Robin Mills over 7 years ago
Thank you for your help. I'm moving house today from California back to England. It'll probably be next week before I have a chance to look at this.
RE: Exiv2 in Chrome extension - Added by Robin Mills over 7 years ago
Right. I finally have some time to look at this. I'm sorry to spoil your day, however I'm unable to follow your instructions. I arrive a step 4 and here's what happens
598 rmills@rmills-mbp:~/gnu/exiv2/dev/naclports/src $ make exiv2 build_tools/naclports.py install exiv2 Building 'zlib' [i686/newlib/release] Build complete 'zlib' [i686/newlib/release] [took 9s] Installing 'zlib' [i686/newlib/release] naclports: invalid file in package: ._. make: *** [exiv2] Error 1 599 rmills@rmills-mbp:~/gnu/exiv2/dev/naclports/src $
There's a little issue with the documentation mentioning pepper33, which I believe should be pepper35.
Exactly where is bin/ ? This is a relative path. Relative to where ~/dev ? Is the only item in bin to be bin/exiv2?
The recipe is rather complicated. Please remember that I know nothing about chrome extensions and don't know what to expect here. When something fails unexpectedly, I have no idea how to proceed as I don't know where we're going!
Is it possible to create a script to take care of everything?
Robin
RE: Exiv2 in Chrome extension - Added by Benjamin H. over 7 years ago
I cannot reproduce the error you reported: invalid file in package: ._.
bin/ is relative to extension's main directory, which when cloning already contains files built with pepper_33.
You're right. pepper_33 now is pepper_35 (https://github.com/bhenne/ChromeExtension-PhotoMetadataPrivacy/issues/1).
I added a note to INSTALL some days ago, so git pull. The other bug you reported
was fixed in naclports-exiv2's git. So you need to pull/copy that again, or start from scratch.
I slightly extended and pushed the INSTALL file -- I just built the binaries by copy/pasting all commands to console using OS X 10.7.
A script might not always work. For instance gclient command interactively asked for a config update when I used it the first time today.
However, the git repo contains older builds of the binaries, so others may just clone it and use the extension.
RE: Exiv2 in Chrome extension - Added by Robin Mills over 7 years ago
Benjamin
Thank You very much for being patient with me. It's working and I am really delighted and very impressed. Good Job.
The image here was used in testing our "Web Ready" feature which will ship in Exiv2 v0.25. This feature provides support for reading and writing metadata using http(s), ftp(s), ssh protocols. I'd like acknowledge the excellent contribution of Tuan to add internet protocol support to Exiv2. Tuan participated in Exiv2 as a Student in the Program: "Google Summer of Code 2013".
I'll run your procedure next week on Linux and Windows and give you an update on my progress.
Thank You for sharing this and for your assistance to get it running on MacOS-X 10.9. Your instructions are faultless.
515 rmills@rmillsmbp:~/gnu/exiv2/gsoc13 $ exiv2 -pa http://clanmills.com/LargsPanorama.jpg Exif.Image.Orientation Short 1 top, left Exif.Image.XResolution Rational 1 72 Exif.Image.YResolution Rational 1 72 Exif.Image.ResolutionUnit Short 1 inch Exif.Image.Software Ascii 29 Adobe Photoshop CS Macintosh Exif.Image.DateTime Ascii 20 2007:01:28 11:28:40 Exif.Image.ExifTag Long 1 164 Exif.Photo.ColorSpace Short 1 Uncalibrated Exif.Photo.PixelXDimension Long 1 2160 Exif.Photo.PixelYDimension Long 1 345 Exif.Thumbnail.Compression Short 1 JPEG (old-style) Exif.Thumbnail.XResolution Rational 1 72 Exif.Thumbnail.YResolution Rational 1 72 Exif.Thumbnail.ResolutionUnit Short 1 inch Exif.Thumbnail.JPEGInterchangeFormat Long 1 302 Exif.Thumbnail.JPEGInterchangeFormatLength Long 1 1688 Xmp.exif.ColorSpace XmpText 10 (4294967295) Xmp.exif.PixelXDimension XmpText 4 2160 Xmp.exif.PixelYDimension XmpText 3 345 Xmp.photoshop.History XmpText 0 Xmp.tiff.Orientation XmpText 1 top, left Xmp.tiff.XResolution XmpText 4 72 Xmp.tiff.YResolution XmpText 4 72 Xmp.tiff.ResolutionUnit XmpText 1 inch Xmp.xmp.CreateDate XmpText 20 2007-01-28T11:28:40Z Xmp.xmp.ModifyDate XmpText 20 2007-01-28T11:28:40Z Xmp.xmp.MetadataDate XmpText 20 2007-01-28T11:28:40Z Xmp.xmp.CreatorTool XmpText 28 Adobe Photoshop CS Macintosh Xmp.xmpMM.DocumentID XmpText 58 adobe:docid:photoshop:d55579f3-b053-11db-9c6f-ee9b066f2204 Xmp.xmpMM.InstanceID XmpText 41 uuid:d55579f4-b053-11db-9c6f-ee9b066f2204 Xmp.dc.format XmpText 10 image/jpeg 516 rmills@rmillsmbp:~/gnu/exiv2/gsoc13 $
The Image is a photo of the the beautiful town of Largs, Scotland where I was born.
RE: Exiv2 in Chrome extension - Added by Benjamin H. over 7 years ago
Thank you!
More example images including GPS data and embedded person tags are located at
https://github.com/bhenne/ChromeExtension-PhotoMetadataPrivacy/blob/master/test/
Some screenshots can be found at the describing website at
http://bhenne.github.io/ChromeExtension-PhotoMetadataPrivacy/
and in the publication linked on that page.
It's a pity that we only could implement the modification of metadata on upload
as a proof of concept for basic html forms right now due to API limitations.
RE: Exiv2 in Chrome extension - Added by Nehal J Wani over 7 years ago
I was able to build the chrome extension successfully on Fedora 19
using the steps mentioned at github
3 Cheers for Benjamin!