Package com.google.zxing

Examples of com.google.zxing.MultiFormatReader


        this.checkFormat(in, format);
        in.delete();
    }
   
    private void checkFormat(File file, BarcodeFormat format) throws IOException {
        Reader reader = new MultiFormatReader();
        BinaryBitmap bitmap = new BinaryBitmap(new HybridBinarizer(new BufferedImageLuminanceSource(ImageIO.read(file))));
        Result result;
        try {
            result = reader.decode(bitmap);
        } catch (ReaderException ex) {
            throw new IOException(ex);
        }
       
        assertEquals(format, result.getBarcodeFormat());
View Full Code Here


     * @return
     * @throws Exception
     */
    private String readImage(final Exchange exchange, final InputStream stream)
        throws Exception {
        final MultiFormatReader reader = new MultiFormatReader();
        final BufferedInputStream in = exchange.getContext()
                .getTypeConverter()
                .mandatoryConvertTo(BufferedInputStream.class, stream);
        final BinaryBitmap bitmap = new BinaryBitmap(
                new HybridBinarizer(
                        new BufferedImageLuminanceSource(ImageIO.read(in))));
        final Result result = reader.decode(bitmap, readerHintMap);
       
        // write the found barcode format into the header
        exchange.getOut()
                .setHeader(Barcode.BARCODE_FORMAT, result.getBarcodeFormat());
       
View Full Code Here

     * @return
     * @throws Exception
     */
    private String readImage(final Exchange exchange, final InputStream stream)
        throws Exception {
        final MultiFormatReader reader = new MultiFormatReader();
        final BufferedInputStream in = exchange.getContext()
                .getTypeConverter()
                .mandatoryConvertTo(BufferedInputStream.class, stream);
        final BinaryBitmap bitmap = new BinaryBitmap(
                new HybridBinarizer(
                        new BufferedImageLuminanceSource(ImageIO.read(in))));
        final Result result = reader.decode(bitmap, readerHintMap);
       
        // write the found barcode format into the header
        exchange.getOut()
                .setHeader(Barcode.BARCODE_FORMAT, result.getBarcodeFormat());
       
View Full Code Here

    BinaryBitmap bitmap = new BinaryBitmap(new HybridBinarizer(source));
    Hashtable<DecodeHintType, Object> hints = new Hashtable<DecodeHintType, Object>();
    hints.put(DecodeHintType.TRY_HARDER, Boolean.TRUE);
    Result[] results = null;
    try {
      MultiFormatReader multiFormatReader = new MultiFormatReader();
      // Result result = multiFormatReader.decode(bitmap, hints);
      GenericMultipleBarcodeReader reader = new GenericMultipleBarcodeReader(multiFormatReader);
      results = reader.decodeMultiple(bitmap, hints);
    }
    catch (NotFoundException exception) {
View Full Code Here

TOP

Related Classes of com.google.zxing.MultiFormatReader

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.