title: Detect and decode multiple 2d (Datamatrix, QRcode) from an image
body: <p>I'm working on a project which involves taking an image file as input on my desktop and then detecting and decoding all the barcodes present, both 1D and 2D.</p>
  
  <p>I've been working with zxing and with the help of GenericMultipleBarcodeReader I was able to read multiple 1D barcodes from the image. However, it fails to detect 2D barcodes.
  But if I crop the 2D barcode and input this cropped part separately it detects and decodes it without any problem.</p>
  
  <p>So, if my image has 2 1D barcode and a 2D barcode my output consists of just the 2 1D barcodes decoded.</p>
  
  <p>I also tried using ByQuadrantReader but that doesn't work either.</p>
  
  <p>My code:</p>
  
  <pre><code>LuminanceSource source = new BufferedImageLuminanceSource(image); 
  BinaryBitmap bitmap = new BinaryBitmap(new HybridBinarizer(source)); 
  Result[] result; 
  HashMap&lt;DecodeHintType,Object&gt; hints = new HashMap&lt;&gt;(); 
  hints.put(DecodeHintType.TRY_HARDER, Boolean.TRUE); 
      try 
      { 
  result = new GenericMultipleBarcodeReader(new MultiFormatReader()).decodeMultiple(bitmap, hints); 
       } 
      catch (ReaderException re) 
      {
      return re.toString(); 
      } 
      List&lt;String&gt; strings = new ArrayList&lt;String&gt;();
       for (Result r: result)
      {
      strings.add(r.getText()); 
      } 
      return String.valueOf(Arrays.toString(strings.toArray()));
  </code></pre>
  
  <p>Could anyone tell me a way to do this?</p>