Skip to content
This repository has been archived by the owner on Dec 21, 2023. It is now read-only.

Repair it,bug of PlatformImage.cs,offset 16 #481

Open
2bhuinianhua opened this issue Aug 10, 2022 · 0 comments
Open

Repair it,bug of PlatformImage.cs,offset 16 #481

2bhuinianhua opened this issue Aug 10, 2022 · 0 comments

Comments

@2bhuinianhua
Copy link

2bhuinianhua commented Aug 10, 2022

PlatformImage.cs

                private void GetPngDimension(out int width, out int height)
		{
			width = 0;
			height = 0;

			// Look into the byte array and get the size of the image
			for (int i = 0; i <= 3; i++)
			{
				width = _bytes[i] | width << 8;
				height = _bytes[i + 4] | height << 8;
			}
		}

It should be:

                private void GetPngDimension(out int width, out int height)
		{
			width = 0;
			height = 0;
                        int offset=16;
			// Look into the byte array and get the size of the image
			for (int i = 0; i <= 3; i++)
			{
				width = _bytes[i+offset] | width << 8;
				height = _bytes[i + 4+offset] | height << 8;
			}
		}
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant