mirror of
https://github.com/openai/codex.git
synced 2026-04-28 16:45:54 +00:00
feat: placeholder for image that can't be decoded to prevent 400 (#6773)
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
use image::ImageError;
|
||||
use image::ImageFormat;
|
||||
use std::path::PathBuf;
|
||||
use thiserror::Error;
|
||||
@@ -23,3 +24,15 @@ pub enum ImageProcessingError {
|
||||
source: image::ImageError,
|
||||
},
|
||||
}
|
||||
|
||||
impl ImageProcessingError {
|
||||
pub fn is_invalid_image(&self) -> bool {
|
||||
matches!(
|
||||
self,
|
||||
ImageProcessingError::Decode {
|
||||
source: ImageError::Decoding(_),
|
||||
..
|
||||
}
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user