Skip to content

Commit

Permalink
make_colorspace: don't panic on unknown color spaces
Browse files Browse the repository at this point in the history
  • Loading branch information
badicsalex committed Sep 19, 2022
1 parent c2785e5 commit 3c4509d
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1449,6 +1449,7 @@ pub enum ColorSpace {
Lab(Lab),
Separation(Separation),
ICCBased(Vec<u8>),
Other,
}

fn make_colorspace<'a>(doc: &'a Document, name: &[u8], resources: &'a Dictionary) -> ColorSpace {
Expand Down Expand Up @@ -1510,9 +1511,7 @@ fn make_colorspace<'a>(doc: &'a Document, name: &[u8], resources: &'a Dictionary
})
}
"Pattern" => ColorSpace::Pattern,
_ => {
panic!("color_space {:?} {:?} {:?}", name, cs_name, cs)
}
_ => ColorSpace::Other,
}
}
}
Expand Down

0 comments on commit 3c4509d

Please sign in to comment.