implement image preview
This commit is contained in:
@ -56,16 +56,9 @@ impl ProtocolHandler for ServerState {
|
||||
) -> ProtocolResult<Vec<u8>> {
|
||||
let mut data_store = self.data_store.write().unwrap();
|
||||
|
||||
match data_store.get_texture_preview(&hash, format) {
|
||||
Ok(data) => Ok(data),
|
||||
Err(TextureFileError::NotFound) => Err(ProtocolError::FileNotFound(
|
||||
"Texture not found!".to_string(),
|
||||
)),
|
||||
Err(TextureFileError::ImageError(_)) => Err(ProtocolError::FileNotFound(
|
||||
"Didn't Find valid Texture File".to_string(),
|
||||
)),
|
||||
Err(TextureFileError::IoError(err)) => Err(ProtocolError::InternalServerError(err)),
|
||||
}
|
||||
let preview = data_store.get_texture_preview(&hash, format)?;
|
||||
|
||||
Ok(preview)
|
||||
}
|
||||
|
||||
fn replace_texture(
|
||||
|
Reference in New Issue
Block a user