Skip to content

Commit

Permalink
Merge pull request #747 from refi64/alpha-screenshot
Browse files Browse the repository at this point in the history
fix: Don't use padding in screenshot pixels as the alpha channel
  • Loading branch information
alexmercerind committed Apr 30, 2024
2 parents 488d188 + cc1a684 commit 6b0d415
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions media_kit/lib/src/player/native/player/real.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2847,7 +2847,7 @@ Uint8List? _screenshot(_ScreenshotData data) {
final pixels = Image(
width: w,
height: h,
numChannels: 4,
numChannels: 3,
);
for (final pixel in pixels) {
final x = pixel.x;
Expand All @@ -2856,7 +2856,6 @@ Uint8List? _screenshot(_ScreenshotData data) {
pixel.b = bytes[i];
pixel.g = bytes[i + 1];
pixel.r = bytes[i + 2];
pixel.a = bytes[i + 3];
}
image = encodeJpg(pixels);
break;
Expand All @@ -2866,7 +2865,7 @@ Uint8List? _screenshot(_ScreenshotData data) {
final pixels = Image(
width: w,
height: h,
numChannels: 4,
numChannels: 3,
);
for (final pixel in pixels) {
final x = pixel.x;
Expand All @@ -2875,7 +2874,6 @@ Uint8List? _screenshot(_ScreenshotData data) {
pixel.b = bytes[i];
pixel.g = bytes[i + 1];
pixel.r = bytes[i + 2];
pixel.a = bytes[i + 3];
}
image = encodePng(pixels);
break;
Expand Down

0 comments on commit 6b0d415

Please sign in to comment.