From 80bd817ef6dd8a4456627b3dd353b02af8283d46 Mon Sep 17 00:00:00 2001 From: andrew Date: Mon, 26 Mar 2018 18:50:32 -0700 Subject: [PATCH] updates to exif --- .idea/workspace.xml | 212 ++++++++++++++++++++++++++++++++++++++++---- index.html | 7 +- js/app.js | 44 ++++++++- 3 files changed, 242 insertions(+), 21 deletions(-) diff --git a/.idea/workspace.xml b/.idea/workspace.xml index e7c07d1..717ff36 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -4,6 +4,7 @@ + @@ -24,11 +25,11 @@ - + - - + + @@ -47,11 +48,11 @@ - + - - + + @@ -60,8 +61,8 @@ - - + + @@ -87,10 +88,10 @@ @@ -102,9 +103,9 @@ @@ -184,14 +185,15 @@ + - - + @@ -201,7 +203,7 @@ - + @@ -226,6 +228,41 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -353,6 +390,49 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -363,8 +443,108 @@ - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/index.html b/index.html index 711313b..3e94401 100644 --- a/index.html +++ b/index.html @@ -136,7 +136,8 @@

Cool, what else can you do for me?

Sign up today
Maybe you need a better place to store you photos? Someplace where you continue to own your images and have full control over who and what you share them with? A place where the terms of service aren't shady and confusing? - We are building an awesome photo storage, management, and sharing tool that you are going to really like.
+ We are building an awesome photo storage, management, and sharing tool that you are going to really like. Click ths sign up button above to join our waitlist. +
@@ -146,7 +147,7 @@

Cool, what else can you do for me?

@@ -156,7 +157,7 @@

diff --git a/js/app.js b/js/app.js index 3b0e5f2..a3f0fe9 100644 --- a/js/app.js +++ b/js/app.js @@ -62,7 +62,7 @@ var Textile = { .toArray() .reduce(function(p, c) { var item = $(c); - p[item.attr('href').split(".html")[0]] = item.html().split(" - ")[0]; + p[item.attr('href').split(".html")[0]] = {folder: item.html().split(" - ")[0]}; return p }, {}); } @@ -70,15 +70,55 @@ var Textile = { return mapper }) .then(function(mapper) { + var meta = {}; + var targets = [] + zip.forEach(function (relativePath, zipEntry) { // 2) print entries + if (relativePath.match(/^photos\/\S*html/)) { + targets.push(zipEntry) + } + }) + var promises = targets.map(function(zipEntry){ + return zipEntry.async("string").then(function(fileData){ + var html = $.parseHTML(fileData); + html.forEach(function(el) { + $(el).find(".block") + .toArray() + .forEach(function(v, i) { + var link = $(v).find('img').attr('src'); + var parts = link.split('.jpg')[0].split('/'); + var id = parts[parts.length - 1].split('_')[1]; + var taken = $(v).find('div div.meta').html(); + meta[id] = {"date": taken} + var tablemeta = $(v).find('div table.meta'); + $(tablemeta).find('tr').toArray().forEach(function(m, ii) { + var kk = $(m).find('th').html(); + var val = $(m).find('td').html(); + meta[id][kk] = val + }) + }, {}); + }); + }) + }) + return Promise.all(promises).then(function(){ + return {"mapper": mapper, "meta": meta} + }) + }) + .then(function(info) { + var mapper = info['mapper']; + var meta = info['meta']; zip.forEach(function (relativePath, zipEntry) { // 2) print entries var name; if (relativePath.match(/^photos\/\S*\/\S*jpg/)) { var index = relativePath.lastIndexOf("/"); - var base = mapper[relativePath.substring(0, index)]; + var base = mapper[relativePath.substring(0, index)].folder; var photo = relativePath.substring(index); if (base === undefined) { base = relativePath.substring(0, index) } + var photoId = photo.replace("/", "").replace(".jpg", "") + + console.log(meta[photoId]) + Textile.file.file("Photos/" + base + photo, zipEntry._data) }