<commit_before><html>
<head>
<style type="text/css">
body { font-family: arial; font-size:small }
.r { display:table-row }
.c { display:table-cell }
.err { font-size:200%; color: red }
.dir { font-family: Courier New, sans-serif }
code { color: green }
h3 { margin: 0px; margin-bottom: 3px }
#thumbs { width:280px }
</style>
</head>
<body>
<div id="spinner" style="background-color:#fff; position:absolute"><img src="static/img/spinner.gif"></div>
<script language="javascript" src="static/js/jquery-1.6.1.js"></script>
<script>
jQuery.fn.center = function () {
	this.css("position","absolute");
	this.css("top", ( $(window).height() - this.height() ) / 2+$(window).scrollTop() + "px");
	this.css("left", ( $(window).height() - this.width() ) / 2+$(window).scrollLeft() + "px");
	return this;
}
$('#spinner').center();
$('#spinner').show();
</script>

<?php

/*
 * Image minimizer gui.
 * 
 * Author: <NAME> <<EMAIL>>
 * 
 * Resamples/re-encodes images in popular web formats to reduce size to reduce bandwidth.
 * Relies on
 * 	ImageMagick http://www.imagemagick.org/
 *	pngnq http://pngnq.sourceforge.net/
 */

define('THUMBSIZE', 100);
define('TEMPDIR', './tmp/');
define('TEMPABS', realpath('.') . '/' . TEMPDIR);
define('IMGMINPATH', './');
#define('IMAGEMAGICKPATH', '/home/rflynn/ImageMagick-6.7.0-6/utilities/');
define('IMAGEMAGICKPATH', '/usr/local/bin/');

// check temp dir setup
if (!file_exists(TEMPDIR))
	tempdir_error('does not exist', true);
else if (!is_writable(TEMPDIR))
	tempdir_error('is not writable by the application');

/*
 * for each image in [original + original.resampled]:
 * 	calculate difference metrics between it and the original image
 *	generate jquery/javascript which adds it to the thumb panel
 */
function displayThumb($orig)
{<commit_msg>be smarter about paths<commit_after><html>
<head>
<style type="text/css">
body { font-family: arial; font-size:small }
.r { display:table-row }
.c { display:table-cell }
.err { font-size:200%; color: red }
.dir { font-family: Courier New, sans-serif }
code { color: green }
h3 { margin: 0px; margin-bottom: 3px }
#thumbs { width:280px }
</style>
</head>
<body>
<div id="spinner" style="background-color:#fff; position:absolute"><img src="static/img/spinner.gif"></div>
<script language="javascript" src="static/js/jquery-1.6.1.js"></script>
<script>
jQuery.fn.center = function () {
	this.css("position","absolute");
	this.css("top", ( $(window).height() - this.height() ) / 2+$(window).scrollTop() + "px");
	this.css("left", ( $(window).height() - this.width() ) / 2+$(window).scrollLeft() + "px");
	return this;
}
$('#spinner').center();
$('#spinner').show();
</script>

<?php

/*
 * Image minimizer gui.
 * 
 * Author: <NAME> <<EMAIL>>
 * 
 * Resamples/re-encodes images in popular web formats to reduce size to reduce bandwidth.
 * Relies on
 * 	ImageMagick http://www.imagemagick.org/
 *	pngnq http://pngnq.sourceforge.net/
 */

define('THUMBSIZE', 100);
define('TEMPDIR', './tmp/');
define('TEMPABS', realpath('.') . '/' . TEMPDIR);
define('IMGMINPATH', file_exists('./imgmin.sh') ? './' : '../');

$which = `which convert`;
define('IMAGEMAGICKPATH', substr($which, 0, strrpos($which, '/')+1));

// check temp dir setup
if (!file_exists(TEMPDIR))
	tempdir_error('does not exist', true);
else if (!is_writable(TEMPDIR))
	tempdir_error('is not writable by the application');

/*
 * for each image in [original + original.resampled]:
 * 	calculate difference metrics between it and the original image
 *	generate jquery/javascript which adds it to the thumb panel
 */
function displayThumb($orig)
{
{'fraction_non_alphanumeric': 0.20279329608938548, 'fraction_numerical': 0.0111731843575419, 'mean_word_length': 4.684126984126984, 'pattern_counts': {'":': 0, '<': 37, '<?xml version=': 0, '>': 35, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4903981', 'n_tokens_mistral': 1270, 'n_tokens_neox': 1251, 'n_words': 294}