-
-
Notifications
You must be signed in to change notification settings - Fork 1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make EXIF data displayed configurable #44
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -307,46 +307,18 @@ | |
}); | ||
|
||
function getExifDataMarkup(img) { | ||
var exif = fetchExifData(img); | ||
var exif_display = $('#main').data('exif-display'); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same here. |
||
var template = ''; | ||
for (var info in exif) { | ||
if (info === "model") { | ||
template += '<i class="fa fa-camera-retro" aria-hidden="true"></i> ' + exif["model"] + ' '; | ||
} | ||
if (info === "aperture") { | ||
template += '<i class="fa fa-dot-circle-o" aria-hidden="true"></i> f/' + exif["aperture"] + ' '; | ||
} | ||
if (info === "shutter_speed") { | ||
template += '<i class="fa fa-clock-o" aria-hidden="true"></i> ' + exif["shutter_speed"] + ' '; | ||
} | ||
if (info === "iso") { | ||
template += '<i class="fa fa-info-circle" aria-hidden="true"></i> ' + exif["iso"] + ' '; | ||
for (var current in exif_display) { | ||
var current_data = exif_display[current]; | ||
var exif = EXIF.getTag(img, current_data['tag']); | ||
if (typeof exif !== "undefined") { | ||
template += '<i class="fa fa-' + current_data['icon'] + '" aria-hidden="true"></i> ' + exif + ' '; | ||
} | ||
} | ||
return template; | ||
} | ||
|
||
function fetchExifData(img) { | ||
var exifData = {}; | ||
|
||
if (EXIF.getTag(img, "Model") !== undefined) { | ||
exifData.model = EXIF.getTag(img, "Model"); | ||
} | ||
|
||
if (EXIF.getTag(img, "FNumber") !== undefined) { | ||
exifData.aperture = EXIF.getTag(img, "FNumber"); | ||
} | ||
|
||
if (EXIF.getTag(img, "ExposureTime") !== undefined) { | ||
exifData.shutter_speed = EXIF.getTag(img, "ExposureTime"); | ||
} | ||
|
||
if (EXIF.getTag(img, "ISOSpeedRatings") !== undefined) { | ||
exifData.iso = EXIF.getTag(img, "ISOSpeedRatings"); | ||
} | ||
return exifData; | ||
} | ||
|
||
}); | ||
|
||
})(jQuery); | ||
})(jQuery); |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,7 +16,7 @@ <h1><a href="index.html"><strong>{{ site.header.title }}</strong> {{ site.header | |
</header> | ||
|
||
<!-- Main --> | ||
<div id="main"> | ||
<div id="main" data-exif-display='{{ site.exif_display }}'> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. And here. |
||
{% for image in site.static_files %} | ||
{% if image.path contains 'fulls' %} | ||
<article class="thumb"> | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe a better name would be
exif_tags
instead ofexif_display
.