title: Xamarin.Forms ZXing BarcodeReaderGeneric returns null when scanning an image in the gallery
body: <p>I am developing a barcode reader with Xamarin.Forms. And I'm trying to scan the image on Android device.</p>
  <p>First I select the image from the gallery with Xamarin.Essentials MediaPicker and from the path of this image I get an RGBLuminance with the Dependency class.</p>
  <p>Then I am trying to decode this RGBLuminance with the <strong>Decode()</strong> method of the ZXing <strong>BarcodeReaderGeneric</strong> class. However, the result always returns null.</p>
  <p>It is my demo project : <a href="https://onedrive.live.com/?authkey=%21AFLjjM91wgZkBGU&amp;cid=58BE2C2C3447FFA2&amp;id=58BE2C2C3447FFA2%219829&amp;parId=root&amp;action=locate" rel="nofollow noreferrer">https://onedrive.live.com/?authkey=%21AFLjjM91wgZkBGU&amp;cid=58BE2C2C3447FFA2&amp;id=58BE2C2C3447FFA2%219829&amp;parId=root&amp;action=locate</a></p>
  <p>Command in the ViewModel class:</p>
  <pre class="lang-cs prettyprint-override"><code>        public ICommand PickCommand =&gt; new Command(PickImage);
          private async void PickImage()
          {
              var pickResult = await MediaPicker.PickPhotoAsync(new MediaPickerOptions
              {
                  Title = &quot;Select a barcode.&quot;
              });
              var path = pickResult.FullPath;
  
              var RGBLuminance = DependencyService.Get&lt;ILuminance&gt;().GetRGBLuminanceSource(path);
              var reader = new BarcodeReaderGeneric();
              var result = reader.Decode(RGBLuminance); // result always null.
          }
  </code></pre>
  <p>Method of Dependency class in Android:</p>
  <pre class="lang-cs prettyprint-override"><code>        public RGBLuminanceSource GetRGBLuminanceSource(string imagePath)
          {
              
              if (File.Exists(imagePath))
              {
                  Android.Graphics.Bitmap bitmap = BitmapFactory.DecodeFile(imagePath);
                  List&lt;byte&gt; rgbBytesList = new List&lt;byte&gt;();
                  for (int y = 0; y &lt; bitmap.Height; y++)
                  {
                      for (int x = 0; x &lt; bitmap.Width; x++)
                      {
                          var c = new Android.Graphics.Color(bitmap.GetPixel(x, y));
                          rgbBytesList.AddRange(new[] { c.A, c.R, c.G, c.B });
                      }
                  }
                  byte[] rgbBytes = rgbBytesList.ToArray();
                  return new RGBLuminanceSource(rgbBytes, bitmap.Height, bitmap.Width, RGBLuminanceSource.BitmapFormat.RGB32);
              }
              return null;
          }
  </code></pre>