-
Notifications
You must be signed in to change notification settings - Fork 2
GIF File display #4
Comments
Hi there! Thanks for the suggestion, but one of my goals is to avoid major dependencies outside of the Python standard library. A single-file module I could ship with Gophersnake might work. A major library with native components, not so much. As for searches, a query string is just plain text. You send the server a selector as usual, followed by a tab character, then your search. You can see it at work in |
Hello :) Thanks for getting back to me. I was trying to avoid that too. Sadly it just didnt seem possible in python to offer image display without PIL. I generally also try to avoid dependencies in that way. You could still distribute by freezing if need be...but that is a whole other pain. I'm not certain, as I have not tried, but you may be able to get it to work without PIL for GIF images specifically by using the io module (a built in) like so:
Since tk has native support for GIFs, passing the file-like object ('stream' above) seems like it should work. Just as an FYI: on Ubuntu specifically, but possibly also on other debian distros, you already have a dependency in that Ubuntu does not come with Tk support and you have to get it through apt: I did see you doing that in your code, but it confused me. I had seen the RFC...I guess it just felt weird to send something like:
Am I thinking about that wrong? |
Thanks for the alternate solution, I'll be sure to try it whenever Gophersnake returns to active development. And it's not the same thing: Tkinter is preinstalled on the Mac, included with Python for Windows and there by default on plenty of Linux distributions. It's by and large considered a standard part of Python. Also, it can't be avoided if Gophersnake is to exist at all. Not all dependencies are equal! Last but not least, dunno if it's weird or not, but that's really how Gopher does it. Seems to work, too. |
Definitely agree that it isnt the same thing, just thought I'd mention in case you ever decided to build a .deb or the like. Cool. Hopefully that approach to inline GIFs works. If you'd like (I get this isn't a particularly active project, so it may not matter), I could try it out and submit a PR. Let me know. Cool! Thank you for the info, I'll try that on my client :) |
A pull request would be much appreciated. Thank you! |
Mostly resolved through this pull request. |
Hi there. It doesn't look like this is too actively maintained, but since I am working on a similar project I thought I might be able to help out with GIF image display:
I had been having trouble with GIFs as well. The byte string was coming back from the server solidly, but I couldn't get it to display or download properly. I then tried a PNG and found that using PIL or Pillow (depending on python version) worked. The added bonus is that it will display ALL of your images pretty cleanly (including GIFs). So you can treat type 'g' and type 'I' files the same (as well as type 'p' which I found to be PNG on floodgap).
io is in the standard library, but you'll need to pip or easy_install pillow (which gets imported as PIL in python3).
Hopefully that is useful to you.
I have been having trouble with search for my project. I cannot find documentation anywhere for how an item type '7' expects the query to be transmitted. I looked at your code, but couldnt quite figure out what form a querystring is to take (or if it is actually a querystring?). Any help you can provide would be much appreciated!
The text was updated successfully, but these errors were encountered: