summaryrefslogtreecommitdiff
path: root/src/env.rs
diff options
context:
space:
mode:
authorLaurenz <laurmaedje@gmail.com>2021-01-20 21:33:13 +0100
committerLaurenz <laurmaedje@gmail.com>2021-01-20 21:33:13 +0100
commit84ba547c7c80e45cc8edafcde8714973bb2a3a2f (patch)
treee5b7eb97799def1907f9138cbe1fa001060c0196 /src/env.rs
parentdd246e5bc944f90be7ba2981c2b73520a4bfbf45 (diff)
If expressions 🔀
Diffstat (limited to 'src/env.rs')
-rw-r--r--src/env.rs3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/env.rs b/src/env.rs
index 5746dd2f..aaa04aa2 100644
--- a/src/env.rs
+++ b/src/env.rs
@@ -84,6 +84,9 @@ pub struct ImageResource {
}
impl ImageResource {
+ /// Parse an image resource from raw data in a supported format.
+ ///
+ /// The image format is determined automatically.
pub fn parse(data: Vec<u8>) -> Option<Self> {
let reader = ImageReader::new(Cursor::new(data)).with_guessed_format().ok()?;
let format = reader.format()?;