Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Image Raster bug #7

Closed
niktses opened this issue Mar 13, 2020 · 1 comment
Closed

Image Raster bug #7

niktses opened this issue Mar 13, 2020 · 1 comment

Comments

@niktses
Copy link

niktses commented Mar 13, 2020

you need to add this check because if image is already divisible by 8 you add 8 extra pixels and image is distorted.

if(widthPx % 8 != 0) {
final targetWidth = (widthPx + 8) - (widthPx % 8);
final missingPx = targetWidth - widthPx;
final extra = Uint8List(missingPx);
for (int i = 0; i < heightPx; i++) {
final pos = (i * widthPx + widthPx) + i * missingPx;
oneChannelBytes.insertAll(pos, extra);
}
}

@andrey-ushakov
Copy link
Owner

Fixed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants