Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>I generated a quick table of where, in my pile of photos, the EXIF data is stored:</p> <pre><code>$ find . -type f -exec grep -a -bo Exif {} \; &gt; /tmp/exif $ sort /tmp/exif | uniq -c | sort -n 1 12306:Exif 1 3271386:Exif 1 8210:Exif 1 8234:Exif 1 9234:Exif 2 10258:Exif 24 449:Exif 30 24:Exif 8975 6:Exif $ </code></pre> <p>The clear majority are just a few bytes into the file; a handful are scattered elsewhere, but the worst is only three megabytes into the file. (Give or take.)</p> <p>I wrote a little test script that appears to do what it necessary for a single URL. (Tested by looking for the string <code>AA</code> in chunks of a huge binary file I had available.) This certainly isn't the prettiest program I've written, but it might be an adequate start to a solution. Note that if the <code>Exif</code> text spans the chunks, you're going to retrieve the entire file. That's unfortunate. I hope it doesn't happen often. The <code>66000</code> is there because the JPEG AAP1 block is limited in size to 64 kilobytes and grabbing a bit more is probably better than grabbing a bit less.</p> <pre><code>#!/usr/bin/ruby require 'net/http' require 'uri' url = URI.parse("http://....") begin looking = true extra_size = 0 File.open("/tmp/output", "w") do |f| Net::HTTP.start(url.host, url.port) do |http| request = Net::HTTP::Get.new url.request_uri http.request request do |resp| resp.read_body do |chunk| f.write chunk if (looking) if (chunk.match(/Exif/)) looking = false end elsif (extra_size &lt; 66000) extra_size += chunk.length else throw "done" end end end end end rescue puts "done" exit(0) end </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload