Skip to content

Instantly share code, notes, and snippets.

@fbuchinger
fbuchinger / gist:1501115
Created December 20, 2011 10:33
PhantomJS: Capturing single dom elements as png files
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") {
@fbuchinger
fbuchinger / gist:4001464
Created November 2, 2012 13:46
IG Grid Dependency Data Structure
{
"idfield": "FNAME",
"data": {
"totalrowcount": 726,
"pagesize": 10,
"columns": [{
"name": "FNAME",
"label": "Vorname",
"datatype": "String"
}, {
$(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 / imgtrack.md
Last active August 29, 2015 14:02
mercurial imgtrack extension

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:

@fbuchinger
fbuchinger / pyexiftool-benchmark.py
Last active November 27, 2019 09:19
Benchmark comparing exiftool, pyexiftool and multiprocessed pyexiftool processing speed.
import os
import timeit
import time
import multiprocessing
import exiftool
metadatadir = r"E:\dev\exiftool.js\test\sampleImages\Acer"