Code with Finding: |
class InlineImageUtils {
/**
* Parses an inline image from the provided content parser. The parser must be positioned immediately following the BI operator in the content stream.
* The parser will be left with current position immediately following the EI operator that terminates the inline image
* @param ps the content parser to use for reading the image.
* @param colorSpaceDic a color space dictionary
* @return the parsed image
* @throws IOException if anything goes wring with the parsing
* @throws InlineImageParseException if parsing of the inline image failed due to issues specific to inline image processing
*/
public static InlineImageInfo parseInlineImage(PdfContentParser ps, PdfDictionary colorSpaceDic) throws IOException{
PdfDictionary inlineImageDictionary = parseInlineImageDictionary(ps);
byte[] samples = parseInlineImageSamples(inlineImageDictionary, colorSpaceDic, ps);
return new InlineImageInfo(samples, inlineImageDictionary);
}
}
|