Skip to content

Commit

Permalink
Fix swap flag
Browse files Browse the repository at this point in the history
  • Loading branch information
CommanderRedYT committed Oct 3, 2024
1 parent 39425f3 commit daf9057
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
5 changes: 2 additions & 3 deletions rgb565_converter/converter.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,7 @@ def main():
"--swap",
dest="swap",
help="Swap bytes for 16-bit words.",
default=False,
type=bool
action="store_true"
)
parser.add_argument(
"-n",
Expand Down Expand Up @@ -165,7 +164,7 @@ def convert_png_to_rgb565(input_file: str, output_file: str, swap: bool, namespa
if swap:
rgb = ((rgb & 0xFF) << 8) | ((rgb & 0xFF00) >> 8)

image_content += f"0x{rgb:04X}" + (",\n " if (x % max_line_width == max_line_width-1) else ",")
image_content += f"0x{rgb:04x}" + (",\n " if (x % max_line_width == max_line_width-1) else ", ")

if image_content.endswith("\n "):
image_content = image_content[:-5]
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

setup(
name='rgb565-converter',
version='1.3.2',
version='1.3.3',
description='Convert a file from png to rgb565 (cpp) and vice versa.',
url='https://github.com/CommanderRedYT/rgb565-converter',
author='CommanderRedYT',
Expand Down

0 comments on commit daf9057

Please sign in to comment.