Skip to content

Commit be479e4

Browse files
committed
add pixel stride + update zxing
1 parent 72d7621 commit be479e4

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

Stratum.Droid/Stratum.Droid.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@
5353
<PackageReference Include="Xamarin.AndroidX.ViewPager2" Version="1.1.0.5" />
5454
<PackageReference Include="Xamarin.AndroidX.Work.Runtime" Version="2.10.0.3" />
5555
<PackageReference Include="Xamarin.Google.Android.Material" Version="1.12.0.2" />
56-
<PackageReference Include="StratumAuth.ZXing" Version="1.2.0" />
56+
<PackageReference Include="StratumAuth.ZXing" Version="1.2.1" />
5757
</ItemGroup>
5858
<ItemGroup Condition="!$(DefineConstants.Contains(FDROID))">
5959
<PackageReference Include="Xamarin.GooglePlayServices.Wearable" Version="119.0.0.1" />

Stratum.Droid/src/QrCode/QrCodeImageAnalyser.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -44,16 +44,16 @@ public void Analyze(IImageProxy imageProxy)
4444

4545
private void AnalyseInternal(IImageProxy imageProxy)
4646
{
47-
using var yuvPlane = imageProxy.Image.GetPlanes()[0];
47+
using var lumPlane = imageProxy.Image.GetPlanes()[0];
4848
ReadOnlySpan<byte> bytes;
4949

5050
unsafe
5151
{
52-
var bufferAddress = yuvPlane.Buffer.GetDirectBufferAddress().ToPointer();
53-
bytes = new ReadOnlySpan<byte>(bufferAddress, yuvPlane.Buffer.Remaining());
52+
var bufferAddress = lumPlane.Buffer.GetDirectBufferAddress().ToPointer();
53+
bytes = new ReadOnlySpan<byte>(bufferAddress, lumPlane.Buffer.Remaining());
5454
}
5555

56-
using var imageView = new ImageView(bytes, imageProxy.Width, imageProxy.Height, ImageFormat.Lum, yuvPlane.RowStride);
56+
using var imageView = new ImageView(bytes, imageProxy.Width, imageProxy.Height, ImageFormat.Lum, lumPlane.RowStride, lumPlane.PixelStride);
5757
imageView.Crop(imageProxy.CropRect.Left, imageProxy.CropRect.Top, imageProxy.CropRect.Width(), imageProxy.CropRect.Height());
5858
imageView.Rotate(imageProxy.ImageInfo.RotationDegrees);
5959

Stratum.Test/Stratum.Test.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
<PackageReference Include="xunit.runner.visualstudio" Version="3.0.2">
2525
<PrivateAssets>all</PrivateAssets>
2626
</PackageReference>
27-
<PackageReference Include="StratumAuth.ZXing" Version="1.2.0" />
27+
<PackageReference Include="StratumAuth.ZXing" Version="1.2.1" />
2828
</ItemGroup>
2929
<ItemGroup>
3030
<ProjectReference Include="..\Stratum.Core\Stratum.Core.csproj" />

0 commit comments

Comments
 (0)