Skip to content

Instantly share code, notes, and snippets.

@fbuchinger
fbuchinger / pyexiftool-benchmark.py
Last active Nov 27, 2019
Benchmark comparing exiftool, pyexiftool and multiprocessed pyexiftool processing speed.
View pyexiftool-benchmark.py
import os
import timeit
import time
import multiprocessing
import exiftool
metadatadir = r"E:\dev\exiftool.js\test\sampleImages\Acer"
@fbuchinger
fbuchinger / imgtrack.md
Last active Aug 29, 2015
mercurial imgtrack extension
View imgtrack.md

Mercurial imgtrack extension

Programmers have been using version control systems for decades to record/log/merge/revert changes in their source code. Photographers don't have a similar tool, although they also have to wrangle with many different versions of one photo:

  1. a photo is typically shot in a Camera RAW format, a kind of digital negative, that needs automatic or manual processing to produce a visible image on the screen
  2. the edited Camera RAW photo has to be saved in another format (e.g. Photoshop PSD or JPEG), because RAW is basically a read-only format. Often multiple versions of one image are saved to test different effects and filters.
  3. then the edited photos are published on photosharing sites or online photo galleries. To increase the upload speed, optimized JPEG versions of the source files are created. The gallery software might create additional versions of the image (e.g. thumbnails and smaller previews).

The problem

This multifile-workflow brings a few problems:

View IG.initForm
$(document).ready(function () {
var logger = IG.console.getLogger("init");
IG.widgets.init();
IG.switchedToDefaultTab = false;
logger.debug("Setting validators");
$.validator.setDefaults(IG.config.validationOptions || {});
if (IG.config.tabContainer && IG.config.renderTabs) {
IG.IERoundedTabs(IG.config.tabContainer);
}
if (IG.isModalForm()) {}
@fbuchinger
fbuchinger / gist:4001464
Created Nov 2, 2012
IG Grid Dependency Data Structure
View gist:4001464
{
"idfield": "FNAME",
"data": {
"totalrowcount": 726,
"pagesize": 10,
"columns": [{
"name": "FNAME",
"label": "Vorname",
"datatype": "String"
}, {
@fbuchinger
fbuchinger / gist:1501115
Created Dec 20, 2011
PhantomJS: Capturing single dom elements as png files
View gist:1501115
var page = new WebPage(),
address, output, size;
//capture and captureSelector functions adapted from CasperJS - https://github.com/n1k0/casperjs
capture = function(targetFile, clipRect) {
var previousClipRect;
if (clipRect) {
if (typeof(clipRect) !== "object") {
View gist:1307476
dateFromArray = (dateArr) ->
[year, month, day , hour, minute, second, millisecond] = dateArr
(new Date (year, month || 0, day || 0, minute || 0, second || 0, millisecond || 0))
View .picasa.ini
#==============================================================
# .picasa.ini FILE STRUCTURE
#
# reverse-engineered by Franz Buchinger <fbuchinger@gmail.com>
# licensed to the public domain
#
# Picasa Version(s): 3.8.0
#
# Changelog:
# v0.1: initial release
@fbuchinger
fbuchinger / HolidayTagger
Created Apr 17, 2011
Mockup Implementation of a HolidayTagger with sample holiday data from the United States. Doesn't yet follow the pictagger api spec. Requires underscore.js
View HolidayTagger
function holidayTagger(date) {
var dateYear = date.getFullYear();
var dateMonth = date.getMonth();
var dateDay = date.getDate();
var getEasterDate = _.memoize(function (year) {
var Y = year;
var C = Math.floor(Y / 100);
var N = Y - 19 * Math.floor(Y / 19);
var K = Math.floor((C - 17) / 25);
var I = C - Math.floor(C / 4) - Math.floor((C - K) / 3) + 19 * N + 15;
@fbuchinger
fbuchinger / DateTime Tagger
Created Apr 17, 2011
Mockup implementation of a DateTime Tagger. Requires underscore.js and doesn't yet follow the pictagger.api. Use with care
View DateTime Tagger
function dateTagger(date) {
var months = ['january', 'february', 'march', 'april', 'may', 'june', 'july', 'august', 'september', 'october', 'november', 'december'];
var weekdays = ['sunday', 'monday', 'tuesday', 'wednesday', 'thursday', 'friday', 'saturday'];
function getWeekOfYear(date) {
a = new Date(date.getFullYear(), date.getMonth(), date.getDate() - date.getDay() + 5);
b = new Date(a.getFullYear(), 0, 4);
return ~~ ((a - b) / 864e5 / 7 + 1.5);
}
@fbuchinger
fbuchinger / gist:674212
Created Nov 12, 2010
OxJs - jQuery for your Bytes
View gist:674212

OxJs - jQuery for your Bytes

OxJs (speak: HexaJs) is a utility library for javascript, that facilitates parsing and creation of binary data in Javascript. While this sounds weird in the first moment, there are a few areas where OxJs can come in handy:

  • If you need to transfer huge amounts of numercial data via AJAX, binary encoding can be much more space-efficient than transfering it in JSON. The number 41239 for example needs 5 Bytes in JSON, but only 2 Bytes in binary encoding (unsigned short). A more practical example is the The Google Maps Polyline Utility, which saves over 80% of the json payload by binary encoding. However, de- and encoding binary information can be a quite tricky and this is were OxJs helps.

  • For client-side file parsing: Recent enhancements in Javascript allow us byte access for to-be-uploaded files. This can be used to perform enhanced sanity che

You can’t perform that action at this time.