<?php class ImageView extends Device {

	/**
	 * @throws ServerException
	 * @throws BadRequestException
	 */
	public static function get(array $parameters): void {
		if(empty($parameters)){ throw new BadRequestException('No parameters'); }
		$imageId=(int)$parameters[0];
		if($imageId<1){
			throw new BadRequestException('Bad image ID got into ImageView::get');
		}
		dropimagefile::getById($imageId); //Echoes Content-Type header and image data, then exits
	}

}