Let’s talk about air quality data! Join us for Open Call on this topic every Tuesday until Dec. 14. Click here for details!

Question:Does anyone know someone at Archive.org who can enable CORS for images of Harvey pollution?

warren is asking a question about photo-sharing: Follow this topic

by warren | September 22, 2017 04:16 | #14933

I'm trying to set up a workflow for reporters of damaged industrial sites that may be polluting after Harvey and other storms and disasters. Currently people often upload large batches of files to Flickr or Google Drive, but Archive.org is a more sustainable place with a better API.

But I'm also trying to get aerial photos of affected sites (like the flooded oil and gas facilities shown below) to appear on a Leaflet map by using the Archive.org JSON API, which is great.

To make a map on the fly, I'm using exif-js (https://www.npmjs.com/package/exif-js) to access the EXIF metadata of images from Archive.org. But when I do that, I get this error, because exif-js uses XMLHttpRequest to get the exif data:

XMLHttpRequest cannot load https://archive.org/download/grn-harvey/a-img_6340-pert-coke-overflow_36263420874_o_thumb.jpg. Redirect from 'https://archive.org/download/grn-harvey/a-img_6340-pert-coke-overflow_36263420874_o_thumb.jpg' to 'https://ia601501.us.archive.org/35/items/grn-harvey/a-img_6340-pert-coke-overflow_36263420874_o_thumb.jpg' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://localhost:8000' is therefore not allowed access.

I tried a non-redirecting URL, but then I get:

XMLHttpRequest cannot load https://ia601501.us.archive.org/35/items/grn-harvey/a-img_6856-active-pump-oyster-marsh-restoration-cameron-parish_36701894030_o_thumb.jpg. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://localhost:8000' is therefore not allowed access.

Enabling an 'Access-Control-Allow-Origin' header is relatively straightforward. Does anyone know someone at Archive.org who can help with this?

My map code is here: https://github.com/publiclab/leaflet-archive

Demo here: http://publiclab.github.io/leaflet-archive/ (not completely online yet but should be shortly)

Example Harvey image from our current workflow:

image description


Update -- we got some help from Archive.org -- THANKS!!! and were able to set up a proxy as a short-term solution. But the issue is now that EXIF data is not copied into the thumbnails.

I wonder how hard it would be to get Archive.org's thumbnail generators to copy in geodata EXIF tags, or just all EXIF data. I think on ImageMagick it's default unless you use -thumbnail geometry.


Alternatively there are some very clever ways to read just the exif data from a remote image. But i haven't seen an implementation in JavaScript, just Ruby: https://stackoverflow.com/questions/8583671/efficient-read-of-exif-meta-data-from-remote-images-using-ruby#8584391

Update: though it's very slow, check it out:



Alternatively we could try to append EXIF data as Archive.org metadata upon upload.

Made an issue for this! Create bot to detect images with EXIF data and copy it into the Archive.org metadata - https://github.com/publiclab/leaflet-archive/issues/4

Reply to this comment...

Log in to comment