getMessage()); } log_print(THUMBNAIL_SCRIPT." '$original_file' '$thumbnail_file'"); $output = shell_exec(THUMBNAIL_SCRIPT." '$original_file' '$thumbnail_file' 2>&1"); log_print($output); if ($output === false) { log_error("Thumbnail failed"); return ROOT_URL.IMG_DIR.$path; } return_thumbnail: return ROOT_URL.THUMBNAIL_DIR.IMG_DIR.$path; } function add_seperator_ab(string $separator, string $a, string $b): string { if ($a === "") return $b; return $a.$separator.$b; } function is_valid_file_type(string $filename): bool { foreach (FILE_EXTENSIONS as $file_extension) { if (str_ends_with($filename, $file_extension)) return true; } return false; } function is_image_file_type(string $filename): bool { foreach(IMAGE_EXTENSIONS as $file_extension) { if(str_ends_with($filename, $file_extension)) return true; } return false; } ?>