-
Notifications
You must be signed in to change notification settings - Fork 55
Added param to disable image converter #80
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
Conversation
In some cases your image may already be the correct format.
@virgilvox thank you for adding this. Can you please run the black formatter on the edited code. There is a guide here showing how to install and use it: https://learn.adafruit.com/improve-your-code-with-pylint/black |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These changes look good to me. But untested.
I attempted to test them out but was unable to get a successful test in, and now my PyPortal seems to be stuck in a weird state where it will not succeed fetching any data from the network even with sample scripts unrelated to these changes.
@FoamyGuy Per our discussion, please try to test this PR. Let me know if you run into issues. Thanks! |
I'm not sure if it's really related to the code in this PR or not to be honest but I have been unable to successfully test this. I've been trying to test with this code with PyPortal on Circuit Python 5.3.1: # NOTE: Make sure you've created your secrets.py file before running this example
# https://learn.adafruit.com/adafruit-pyportal/internet-connect#whats-a-secrets-file-17-2
import board
from adafruit_pyportal import PyPortal
# Set a data source URL
IMAGE_URL = "http://192.168.1.109:8000/image_compressed2.bmp"
TEXT_URL = "http://192.168.1.109:8000/test.txt"
# Create the PyPortal object
pyportal = PyPortal(
url=TEXT_URL,
image_url_path=IMAGE_URL,
status_neopixel=board.NEOPIXEL,
debug=True,
convert_image=False
)
pyportal.set_background(0xFF00FF)
# Set display to show REPL
#board.DISPLAY.show(None)
# Go get that data
print("Fetching")
data = pyportal.fetch()
while True:
pass As sanity test I added a call to set the background of the screen to pink and that is working properly. The output of the script appears to be normal as far as I can tell. And does indicate that it is setting the image onto the screen.
But the image is not actually shown on the screen. The screen remains pink (or black if I remove the other I took the SDCard out of the pyportal and verified that the Perhaps that is enough to approve this PR? The file is getting downloaded and I can see from the console outputs that it's not getting converted via adafruit.io, which is the point of this PR. But I'd definitely feel better about it if I could actually get it showing on the screen. If I switch my PyPortal to the latest build from S3 I get the same result. File downloaded successfully but not shown on screen. |
Update on this: I think something deeper is going on here preventing |
#83 resolves the issue by switching from |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was able to successfully test this new parameter with the latest version that uses sdcardio
if it's available.
Test on PyPortal 6.0.0-alpha.3
Updating https://github.com/adafruit/Adafruit_CircuitPython_PyPortal to 3.5.0 from 3.4.1: > Merge pull request adafruit/Adafruit_CircuitPython_PyPortal#88 from makermelissa/http-errors > Merge pull request adafruit/Adafruit_CircuitPython_PyPortal#87 from makermelissa/content-headers > Merge pull request adafruit/Adafruit_CircuitPython_PyPortal#80 from virgilvox/patch-1
I'm doing image conversion in my back-end. I'd like to be able to disable the use of the AIO image converter service