Skip to content

Commit 51fe876

Browse files
fix: correct brg format
1 parent 3ed4393 commit 51fe876

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

  • src/resolver_athena_client/client/transformers

src/resolver_athena_client/client/transformers/core.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020

2121

2222
def _is_raw_brg_expected_size(data: bytes) -> bool:
23-
"""Detect if data is already a raw RGB array of expected size."""
23+
"""Detect if data is already a raw BRG array of expected size."""
2424
return len(data) == _expected_raw_size
2525

2626

@@ -57,13 +57,13 @@ def process_image() -> tuple[bytes, bool]:
5757

5858
rgb_bytes = resized_image.tobytes()
5959

60-
# Convert RGB to BGR by swapping channels
60+
# Convert RGB to BRG by swapping channels
6161
brg_bytes = bytearray(len(rgb_bytes))
62-
brg_bytes[:] = rgb_bytes # Initialize with RGB data
6362

6463
for i in range(0, len(rgb_bytes), 3):
65-
brg_bytes[i] = rgb_bytes[i + 2] # B
66-
brg_bytes[i + 2] = rgb_bytes[i] # R
64+
brg_bytes[i] = rgb_bytes[i + 2]
65+
brg_bytes[i + 1] = rgb_bytes[i]
66+
brg_bytes[i + 2] = rgb_bytes[i + 1]
6767

6868
return bytes(brg_bytes), True # Data was transformed
6969

0 commit comments

Comments
 (0)