<commit_before><?php
$TOP_TIPO=false;
require_once( dirname(dirname(dirname(__FILE__))) .'/config/config4.php');
require_once( DEDALO_LIB_BASE_PATH . '/media_engine/class.ImageObj.php');

$photo=$_REQUEST['f'];

# Accept images with get vars
$ar = explode('?', $photo);
if (isset($ar[0])) {
	$photo = $ar[0];
}

# Imagemagick path
/*
echo "<pre>";
system("type convert"); 
echo "</pre>";
*/


/*
$cmd = MAGICK_PATH . 
"convert '$photo' ".
#"-background black -layers -flatten ".
"-strip ".
"-thumbnail 260x400 " .
#"-unsharp 0.2x0.6+1.0 ".
"-quality 100 JPG:-";
*/
#echo ImageMagick::test_image_magick($info=true);
#echo $cmd;die();



# IDENTIFY : Get info aboout source file Colorspace
$colorspace_info  = shell_exec( MAGICK_PATH . "identify -format '%[colorspace]' " .$photo. "[0]" );<commit_msg>Security update; enforce for prevent XSS<commit_after><?php
$TOP_TIPO=false;
require_once( dirname(dirname(dirname(__FILE__))) .'/config/config4.php');
require_once( DEDALO_LIB_BASE_PATH . '/media_engine/class.ImageObj.php');

$photo = safe_xss($_REQUEST['f']);

# Accept images with get vars
$ar = explode('?', $photo);
if (isset($ar[0])) {
	$photo = $ar[0];
}

# Imagemagick path
/*
echo "<pre>";
system("type convert"); 
echo "</pre>";
*/


/*
$cmd = MAGICK_PATH . 
"convert '$photo' ".
#"-background black -layers -flatten ".
"-strip ".
"-thumbnail 260x400 " .
#"-unsharp 0.2x0.6+1.0 ".
"-quality 100 JPG:-";
*/
#echo ImageMagick::test_image_magick($info=true);
#echo $cmd;die();



# IDENTIFY : Get info aboout source file Colorspace
$colorspace_info  = shell_exec( MAGICK_PATH . "identify -format '%[colorspace]' " .$photo. "[0]" );
{'fraction_non_alphanumeric': 0.20708613317043373, 'fraction_numerical': 0.023213194868662187, 'mean_word_length': 4.892086330935252, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 7, 'https://': 0, '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': '6023356', 'n_tokens_mistral': 660, 'n_tokens_neox': 615, 'n_words': 134}