diff --git a/inkycal/main.py b/inkycal/main.py index 122a817..153d745 100644 --- a/inkycal/main.py +++ b/inkycal/main.py @@ -518,12 +518,12 @@ class Inkycal: def _optimize_im(image, threshold=220): """Optimize the image for rendering on ePaper displays""" - buffer = numpy.array(image.convert('RGB')) - red, green = buffer[:, :, 0], buffer[:, :, 1] + #buffer = numpy.array(image.convert('RGB')) + #red, green = buffer[:, :, 0], buffer[:, :, 1] # grey->black - buffer[numpy.logical_and(red <= threshold, green <= threshold)] = [0, 0, 0] - image = Image.fromarray(buffer) + #buffer[numpy.logical_and(red <= threshold, green <= threshold)] = [0, 0, 0] + #image = Image.fromarray(buffer) return image def calibrate(self): diff --git a/inkycal/modules/inkycal_openweather_scrape.py b/inkycal/modules/inkycal_openweather_scrape.py index 1e345d4..ef56b72 100644 --- a/inkycal/modules/inkycal_openweather_scrape.py +++ b/inkycal/modules/inkycal_openweather_scrape.py @@ -64,7 +64,7 @@ def get_scraped_weatherforecast_image() -> Image: driver.execute_script("arguments[0].style.fontSize = '16px';", html_element) # Save as a screenshot - image_filename = "openweather_scraped.png" + image_filename = "/tmp/openweather_scraped.png" driver.save_screenshot(image_filename) # Close the WebDriver when done @@ -75,7 +75,7 @@ def get_scraped_weatherforecast_image() -> Image: im = im.crop((0, 50, my_width, my_height)) #im = im.resize((800, 480), Image.Resampling.LANCZOS) #im = im.rotate(90, Image.NEAREST, expand = 1) - #im = ImageEnhance.Contrast(im).enhance(1.3) + im = ImageEnhance.Contrast(im).enhance(1.3) im.save(image_filename) return im, im @@ -84,4 +84,4 @@ def main(): if __name__ == '__main__': print(f'running {__name__} in standalone/debug mode') - main() \ No newline at end of file + main() diff --git a/run_weather_scraper.sh b/run_weather_scraper.sh index 8391faf..84480ed 100755 --- a/run_weather_scraper.sh +++ b/run_weather_scraper.sh @@ -1,3 +1,3 @@ #!/bin/sh python3 /home/ubuntu/Inkycal/inkycal/modules/inkycal_openweather_scrape.py -scp ./openweather_scraped.png inky@10.10.9.10:~/Inkycal/ +scp -i /home/ubuntu/.ssh/id_rsa /tmp/openweather_scraped.png inky@10.10.9.10:~/Inkycal/