misc: add code review tool

This commit is contained in:
Frédéric Péters 2017-10-16 21:05:07 +02:00
parent 34f72186c0
commit 1563a4ba15
12 changed files with 24 additions and 0 deletions

6
code-review/.htaccess Normal file
View File

@ -0,0 +1,6 @@
DirectoryIndex index.cgi
Options Indexes
Options ExecCGI -MultiViews +SymLinksIfOwnerMatch Indexes +FollowSymLinks
Order allow,deny
Allow from all
AddHandler cgi-script .cgi

1
code-review/README Normal file
View File

@ -0,0 +1 @@
Original image watermarked (c) 2008 Focus Shift

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 28 KiB

BIN
code-review/codereview.xcf Normal file

Binary file not shown.

17
code-review/index.cgi Executable file
View File

@ -0,0 +1,17 @@
#! /usr/bin/env python
import cgi
import os
import subprocess
import sys
print 'Content-type: image/png\n'
cmd = ['convert', 'codereview-base.png']
qs = os.environ.get('QUERY_STRING', '')
for c in '1234567':
if c in qs:
cmd.extend(['codereview-%s.png' % c, '-composite'])
cmd.append('png:-')
sys.stdout.write(subprocess.check_output(cmd))