Skip to content

Instantly share code, notes, and snippets.

Avatar

Warren Young tangentsoft

View GitHub Profile
@tangentsoft
tangentsoft / backup-lrcat
Last active Aug 29, 2015
Lightroom 6 re-compressing backup script
View backup-lrcat
#!/bin/bash
# This script re-compresses an Lr6 zipped lrcat file using xz, which is
# much more efficient. Oddly, it's actually more compatible, since Lr6.0
# uses a variant of Zip that won't even open using built-in OS X utilities.
# Open Lightroom and wait for it to exit. You must then say Cmd-Opt-,
# and tell Lr to "back up catalog when Lightroom next exits", then
# exit. If Lr is already running, this will just wait, so it is not
# important whether you run this script before or after Lr is running.
#
View ticktock.fs
let tickTock() =
for i = 0 to 10 do
if i % 2 = 0 then
printfn "tick %d" i
else
printfn "tock %d" i
tickTock()
System.Console.ReadLine() |> ignore
@tangentsoft
tangentsoft / gist:57ce984f768e77bacb30
Last active Aug 29, 2015
A wild hack at making [jpegtran](http://jpegclub.org/jpegtran/) white-pad images when extending them, instead of using middle gray
View gist:57ce984f768e77bacb30
--- transupp.c.orig 2015-03-16 11:34:25.000000000 -0600
+++ transupp.c 2015-03-16 11:39:12.000000000 -0600
@@ -130,6 +130,9 @@
JBLOCKARRAY src_buffer, dst_buffer;
jpeg_component_info *compptr;
+ JCOEF pad = 1023; /* max for 8-bit JPEG = white; use 16383 for 12-bit JPEG */
+ int pio, pii; /* padding indices for custom FMEMZERO() replacments */
+
MCU_cols = srcinfo->output_width /