<commit_before><?php

require "src/require.php";

echo $_GET['w'] . "x" . $_GET['h'] . "\n";

$fetch = new ImageFetch('placeimg', 'placeimg/generated');
echo $fetch->getPathForImage($_GET['w'], $_GET['h']);<commit_msg>Added return image in request<commit_after><?php

require "src/require.php";

//echo $_GET['w'] . "x" . $_GET['h'] . "\n";

$fetch = new ImageFetch('placeimg', 'placeimg/generated');
$path = $fetch->getPathForImage($_GET['w'], $_GET['h']);

$data = getimagesize($path);
if (!$data) {
   die("Cannot get mime type");
} else {
   header('Content-Type: ' . $data['mime']);
}

readfile($path);
{'fraction_non_alphanumeric': 0.25370675453047775, 'fraction_numerical': 0.0, 'mean_word_length': 5.4, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '5781074', 'n_tokens_mistral': 220, 'n_tokens_neox': 221, 'n_words': 45}