kevinabrandon / AboveTustin

ADS-B Twitter Bot. Uses dump1090-mutability to track airplanes and then tweets whenever an airplane flies overhead.
MIT License
72 stars 21 forks source link

Add basic screenshot cropping #7

Closed Jestre closed 7 years ago

Jestre commented 7 years ago

This should enable basic screenshot cropping, but requires Pillow.

Config variables: do_crop (true|false) - Crop the screenshot? Perhaps the default should be false? crop_width, crop_height - Basically coordinates for the bottom right corner. Using 816 should crop off the data panel and flights table.

My editor also chopped off extraneous whitespace at the ends of lines, so not sure if that is an issue.

Romeo-Golf commented 7 years ago

Although I havent run/tested it, the code looks reasonable to me.. :)

Also would you mind posting a screenshot of the output?

Thanks..

Jestre commented 7 years ago

The screenshot will look like the recent posts on https://twitter.com/aboveraleigh just minus the inset data box in the lower right corner.

kevinabrandon commented 7 years ago

Looks good to me, only thing I would do is add a couple more config vars crop_x and crop_y and set them to zero. Then for the actual crop you could do: im = im.crop((crop_x, crop_y, crop_width, crop_height)).

That way if people wanted they could crop it a bit tighter to remove the maps buttons.

Jestre commented 7 years ago

How did I know that was coming? :) Added and pushed.

kevinabrandon commented 7 years ago

Awesome thanks!

Romeo-Golf commented 7 years ago

yeah looks great, the revised aspect ratio defiantly helps improve readability in the default twitter layout where the tweets seems to get about 1/4 of the screen width :)