Skip to content

Pngwriter optimization#10

Open
PrimeNumb wants to merge 1 commit intomasterfrom
pngwriter-optimize
Open

Pngwriter optimization#10
PrimeNumb wants to merge 1 commit intomasterfrom
pngwriter-optimize

Conversation

@PrimeNumb
Copy link
Owner

  • Optimized Pngwriter slightly
  • Added tests to increase coverage in image.py
  • Fixed a bug where pdf2txt.py would not convert PDFs properly

Added tests to increase coverage in image.py
bmp = BMPWriter(fp, 8, 10, 10)
bmp.write_line(0, b'0')
fp.close()
self.assertTrue(os.path.isfile(filename))
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is always true regardless of what BMPWriter do, right? Then would you add an assertion of the file content

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't think we have access to a BMP parser, no time to write one

Copy link
Owner Author

@PrimeNumb PrimeNumb Oct 6, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually a BMP parser would file it as corrupted because technically speaking the content is not valid for a BMP, we're only testing if it can output anything at all

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

alright, in that case i agree that's the best you can do. thanks for the clarification!

bmp = BMPWriter(fp, 8, 10, 10)
bmp.write_line(0, b'0')
fp.close()
self.assertTrue(os.path.isfile(filename))
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

alright, in that case i agree that's the best you can do. thanks for the clarification!

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

Successfully merging this pull request may close these issues.

3 participants