(filename: impl AsRef<Path>)
| 50 | |
| 51 | impl ImageInfo { |
| 52 | pub fn load(filename: impl AsRef<Path>) -> Result<Self> { |
| 53 | let file = fs::File::open(filename.as_ref()).context("failed to open image info")?; |
| 54 | let info: ImageInfo = |
| 55 | serde_json::from_reader(file).context("failed to parse image info")?; |
| 56 | Ok(info) |
| 57 | } |
| 58 | } |
| 59 | |
| 60 | #[derive(Debug)] |
no test coverage detected