Class ImageParser

  • All Implemented Interfaces:
    com.logicaldoc.core.parser.Parser

    public class ImageParser
    extends com.logicaldoc.core.parser.AbstractParser
    This parser reads images (supported formats are: jpg, jfif, bmp, jpeg, wbmp, png, gif) and extracts text using OCR.
    Since:
    3.5
    Author:
    Alessandro Gasparini - LogicalDOC
    • Constructor Detail

      • ImageParser

        public ImageParser()
    • Method Detail

      • parse

        public String parse​(File file,
                            String filename,
                            String encoding,
                            Locale locale,
                            String tenant,
                            com.logicaldoc.core.document.Document document,
                            String fileVersion)
                     throws com.logicaldoc.core.parser.ParseException
        Specified by:
        parse in interface com.logicaldoc.core.parser.Parser
        Overrides:
        parse in class com.logicaldoc.core.parser.AbstractParser
        Throws:
        com.logicaldoc.core.parser.ParseException
      • internalParse

        public void internalParse​(InputStream input,
                                  String filename,
                                  String encoding,
                                  Locale locale,
                                  String tenant,
                                  com.logicaldoc.core.document.Document document,
                                  String fileVersion,
                                  StringBuilder output)
                           throws com.logicaldoc.core.parser.ParseException
        Throws:
        com.logicaldoc.core.parser.ParseException
      • extractMetadata

        public void extractMetadata​(File file,
                                    StringBuilder output)
        Extracts all image metadata placing them into the content
        Parameters:
        file - the image file
        output - the buffer that hosts the extracted metadata
      • countPages

        public int countPages​(File input,
                              String filename)
        Specified by:
        countPages in interface com.logicaldoc.core.parser.Parser
        Overrides:
        countPages in class com.logicaldoc.core.parser.AbstractParser
      • countPages

        public int countPages​(InputStream input,
                              String filename)
        Specified by:
        countPages in interface com.logicaldoc.core.parser.Parser
        Overrides:
        countPages in class com.logicaldoc.core.parser.AbstractParser