3

I want to read XMP metadata of a JPEG file in JavaScript. I found a way for PHP (How can I read XMP data from a JPG with PHP?) and we can easily adapt it in JavaScript using AJAX, but the problem is : what about the distant images, those which are not on our server?

Thanks

Community
  • 1
  • 1
Jeremy
  • 554
  • 5
  • 16
  • 1
    Just send the url to the server, the server will download it and get the metadata. – Musa Feb 24 '14 at 15:26
  • if you are referring to files in the client's machine, you cannot access files from the client's machine using javascript. you'll need flash. or you can just send the file to the server for temporary storage then you can determine the metadata from the server side. – rationalboss Feb 24 '14 at 15:26
  • @Musa: I currently use this solution, but I would avoid PHP to have a JavaScript-only solution. – Jeremy Feb 24 '14 at 16:16
  • @rationalboss: No, sorry, my message was not totally clear, I want to read images stored on other servers, via its URL. – Jeremy Feb 24 '14 at 16:17
  • You cant due to Same Origin Policy – Musa Feb 24 '14 at 16:24
  • @Musa: And there are not another way to read a file's content? – Jeremy Feb 24 '14 at 16:33

1 Answers1

0

A starting point to read out metadata of an image with javascript is the library exif-js, which i found on github.

https://github.com/jseidelin/exif-js

Bad part is that it only focuses on Exif while XMP information won't be read out.

Dukeatcoding
  • 1,363
  • 2
  • 20
  • 34