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

Add more comments and logging for better readability #44

Merged
merged 1 commit into from Jan 8, 2021

Conversation

davidhcefx
Copy link
Contributor

@davidhcefx davidhcefx commented Jan 7, 2021

Motivation

When reading the code, sometimes it's hard to know the data types or the meaning of variables. For example, what's the type of rectangleMatches? One would need to first go to depix.py and found that it was generated from findRectangleMatches(). After that, he or she knew it was of type dict, but what was the key and values?

Another motivation is that, when I tried out this tool the first time, the target image I used was inappropriate. Within that image, each 14x14 block was supposed to be of same color, but due to some lossy compression, each were instead composed of tiny little blocks as shown below:

bad

I got stuck on this screen for over an hour:

stuck_for_over_an_hour

Therefore, I think it would be better if the program could detect that there was too many variants on block size, which is what I added in depix.py line 47. The additional logging feature in line 109 and line 147 were also for addressing this problem by including more verbosity.

Feel free to edit if you think it's too verbose or redundant.

@spipm spipm merged commit 2255fe9 into spipm:main Jan 8, 2021
@spipm
Copy link
Owner

spipm commented Jan 8, 2021

Awesome thank you!

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