cargo fmt
This commit is contained in:
@@ -66,10 +66,9 @@ impl ThumbnailResponse {
|
|||||||
/// ```
|
/// ```
|
||||||
pub fn decode(&self) -> Result<image::DynamicImage> {
|
pub fn decode(&self) -> Result<image::DynamicImage> {
|
||||||
// Get image format from content type
|
// Get image format from content type
|
||||||
let format = image::ImageFormat::from_mime_type(&self.content_type)
|
let format = image::ImageFormat::from_mime_type(&self.content_type).ok_or_else(|| {
|
||||||
.ok_or_else(|| ImmichError::Image(
|
ImmichError::Image(format!("Unsupported content type: {}", self.content_type))
|
||||||
format!("Unsupported content type: {}", self.content_type)
|
})?;
|
||||||
))?;
|
|
||||||
|
|
||||||
// Create reader with the format and decode
|
// Create reader with the format and decode
|
||||||
image::ImageReader::with_format(Cursor::new(&self.data), format)
|
image::ImageReader::with_format(Cursor::new(&self.data), format)
|
||||||
|
|||||||
Reference in New Issue
Block a user