@@ -79,7 +79,7 @@ impl ImageFormat {
79
79
// thin wrapper function to strip generics
80
80
fn inner ( ext : & OsStr ) -> Option < ImageFormat > {
81
81
let ext = ext. to_str ( ) ?. to_ascii_lowercase ( ) ;
82
-
82
+ // NOTE: when updating this, also update extensions_str()
83
83
Some ( match ext. as_str ( ) {
84
84
"avif" => ImageFormat :: Avif ,
85
85
"jpg" | "jpeg" | "jfif" => ImageFormat :: Jpeg ,
@@ -93,7 +93,7 @@ impl ImageFormat {
93
93
"ico" => ImageFormat :: Ico ,
94
94
"hdr" => ImageFormat :: Hdr ,
95
95
"exr" => ImageFormat :: OpenExr ,
96
- "pbm" | "pam" | "ppm" | "pgm" => ImageFormat :: Pnm ,
96
+ "pbm" | "pam" | "ppm" | "pgm" | "pnm" => ImageFormat :: Pnm ,
97
97
"ff" => ImageFormat :: Farbfeld ,
98
98
"qoi" => ImageFormat :: Qoi ,
99
99
_ => return None ,
@@ -286,12 +286,13 @@ impl ImageFormat {
286
286
/// that yields a slice of `OsStr` which is blocked by several features of const evaluation.
287
287
#[ must_use]
288
288
pub fn extensions_str ( self ) -> & ' static [ & ' static str ] {
289
+ // NOTE: when updating this, also update from_extension()
289
290
match self {
290
291
ImageFormat :: Png => & [ "png" ] ,
291
292
ImageFormat :: Jpeg => & [ "jpg" , "jpeg" ] ,
292
293
ImageFormat :: Gif => & [ "gif" ] ,
293
294
ImageFormat :: WebP => & [ "webp" ] ,
294
- ImageFormat :: Pnm => & [ "pbm" , "pam" , "ppm" , "pgm" ] ,
295
+ ImageFormat :: Pnm => & [ "pbm" , "pam" , "ppm" , "pgm" , "pnm" ] ,
295
296
ImageFormat :: Tiff => & [ "tiff" , "tif" ] ,
296
297
ImageFormat :: Tga => & [ "tga" ] ,
297
298
ImageFormat :: Dds => & [ "dds" ] ,
0 commit comments