<commit_before><?php
/**
 * Resize images on the fly using cache.
 *
 * @author <NAME> <EMAIL>
 * @example http://dbwebb.se/kod-exempel/cimage/
 * @link https://github.com/mosbth/cimage
 *
 */
error_reporting(-1);
set_time_limit(20);

// Do some sanity checks
function errorPage($msg) {
  header("Status: 404 Not Found");
  die('404: ' . $msg);
}

// Custom exception handler
function myExceptionHandler($exception) {
  errorPage("<p><b>img.php: Uncaught exception:</b> <p>" . $exception->getMessage() . "</p><pre>" . $exception->getTraceAsString(), "</pre>");
}
set_exception_handler('myExceptionHandler');


// Use preprocessing of images
define('PNG_FILTER',    '/usr/local/bin/optipng -q');
define('PNG_DEFLATE',   '/usr/local/bin/pngout -q');
define('JPEG_OPTIMIZE', '/usr/local/bin/jpegtran -copy none -optimize');<commit_msg>comment postprocessing<commit_after><?php
/**
 * Resize images on the fly using cache.
 *
 * @author <NAME> <EMAIL>
 * @example http://dbwebb.se/kod-exempel/cimage/
 * @link https://github.com/mosbth/cimage
 *
 */
error_reporting(-1);
set_time_limit(20);

// Do some sanity checks
function errorPage($msg) {
  header("Status: 404 Not Found");
  die('404: ' . $msg);
}

// Custom exception handler
function myExceptionHandler($exception) {
  errorPage("<p><b>img.php: Uncaught exception:</b> <p>" . $exception->getMessage() . "</p><pre>" . $exception->getTraceAsString(), "</pre>");
}
set_exception_handler('myExceptionHandler');


// Use preprocessing of images
#define('PNG_FILTER',    '/usr/local/bin/optipng -q');
#define('PNG_DEFLATE',   '/usr/local/bin/pngout -q');
#define('JPEG_OPTIMIZE', '/usr/local/bin/jpegtran -copy none -optimize');
{'fraction_non_alphanumeric': 0.19630071599045346, 'fraction_numerical': 0.010739856801909307, 'mean_word_length': 4.66554054054054, 'pattern_counts': {'":': 0, '<': 23, '<?xml version=': 0, '>': 25, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, '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': '1381216', 'n_tokens_mistral': 602, 'n_tokens_neox': 583, 'n_words': 116}