} if (!$w) { $editor->resizeToHeight($h); } elseif (!$h) { $editor->resizeToWidth($w); } else { $editor->resize($w, $h, $fitInside); } ob_start(); // Чтобы далее узнать точный размер файла $editor->output(); header_img(2, ob_get_length(), time(), substr($file_name, 0, 20) . '.jpg'); ob_end_flush(); // Кэшируем if ($LocalCache) { $editor->save($LocalCache . $file_name, IMAGETYPE_JPEG, $q); } exit; // Показываем картинку с текстом ошибки function error_gif($t) { $vsize = 46; $t1 = substr($t, 0, 30); if ($t != $t1) { $t1 = ereg_replace(' [^ ]*$', '', $t1); $t2 = trim(substr($t, strlen($t1), 90)); $vsize = 64; } header('HTTP/1.1 404 Not Found'); header_img(1); $coin = imagecreate(250, $vsize);