-
Notifications
You must be signed in to change notification settings - Fork 13
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
Take avatar images and process them #33
Comments
Initial processing of the avatar will need to validate as appropriate image file - attempt open in PIL, convert to png, handle if bad (eg is a text file*) then assume all avatars in app_data should be legitimate. *although...a fun easter egg would be to convert txt file into an image if passed by mistake. |
Hey , I did help with this project before , university just took all my free time. I am off now if you would want me to help you with this issue ? |
Fair enough :) Absolutely. Since it's currently (fingers crossed), working well enough to be used, I've been taking time since Christmas break to learn more about testing, so I can work on improving the tests. |
Hey , I just started playing around with dionysus and here's same things I learned : Bugs
Why is there two copies of the .png chart saved , one in dionysus_charts and another in chart_generator? |
I'll have to look at this tomorrow - I did have the chart saving correctly. Re saving, I wanted to have a copy saved in dionysus_charts (ie wherever the user wants) to be accessed and used by the user, and another saved in the application's data (
|
I'm not sure why closing the image breaks the app, but I did chase down why (I think) the plots are blank. Somewhere along the line I refactored the logic for building the chart, and added a save file dialogue, and the plt.show was moved before the save image code. When I tried simply moving the plt.show() call to before the save image function call, something odd happened, it showed the image, but instead of having to hit the 'x' in the top corner before returning to the prompt, the save dialogue popped up too, and after hitting x and saving the image (in either order), it still hung. I'm going to refactor it to save the chart data and image with the chart title, then display the image with an 'ok' button, then spawn the save as dialogue, and copy the image from the class_data save location to the user specified location. |
Should be fixed, possibly better than before (when it was working anyway). Still need to add tests - if I'd had it adequately tested I'd have realised I broke it with some refactoring. Don't know how to test content of saved images though. I've created a separate avatar_processing branch for you to commit these changes to. That way any changes I'm making in development (eg when I add tests and fix the bugs they find...) don't affect what you're doing too much. I can always rebase it on development if needs be. :) |
Ok cool. Are you open to the idea to maybe create another version of dionysus which is a web application?There's so much that we can do to improve the overall user ability of the application. Users will not need to install anything and run it straight from their browser. We could use something like Flask. Another thing, we could maybe connect dionysus to a database to store user info and login from the terminal. I prefer MongoDB , because they provide a free cloud cluster with 512 MB that we could us for testing. MongoDB is very easy to work and pymongo is very simple syntax. |
I was already semi-planning on it, at least running it as a webapp running off the desktop, which I know flask can do without network access. :) #122 My query with having something hosted and served is really about security and privacy. The original inspiration for this was for my wife (who's a teacher), but handling of student data is a serious issue for many people, so that has to be done right, particularly when people will upload photos and names together. As for Mongo - I've heard of it, but never used it - I was planning on learning PostgreSQL and Flask as my next step. Can MongoDB store images well? For large images I know the filesystem is best, but I've read that at least for smaller images in Postgres, it's faster to save small images in the DB than retrieve from filesystem. |
Security and privacy is very important in any web application to all
developers , except in the case of Facebook :) I'm still new to a lot of
it, but we could have a back-end API that needs a JWT token or OAuth to
serve data like a students info or a graph to a teacher.And the user will
only obtain a token if they could login successfully , another level of
security.
We could do more research into it if you would want to continue with the
hosted web application idea. We can even do testing by hosting it on a
GitHub page that uses https protocol.
Mongo does allow us to store files like an image. If we keep the files to
upload below 16MB we can use BSON document or we could use their GridFS
system.We can also do it with PostgreSQL , but I haven't used it.I may need
to use it in the coming months at university , so I'm down to learn it with
you then.
|
Oh yes, Can we maybe change the shape of the students avatar to a circle ? I think it will look better |
That's not a bad idea. Go for it. Ultimately I'd love to have things like that customisable through a GUI. But my initial goal was having something functional for my wife by Christmas. |
I've been working on factoring out the UI stuff from the backend logic. I'm relatively new to webapps, but I'm wondering if we can have the app run with arguments such that it will run as a CLI app using the backend logic with CLI frontend, and as a server using the same backend logic when run as a service. Or do you think we just need to start a new repo? |
Code for accepting user images,and processing them for application usage.
- check is valid image file
- check for correct size/proportion -> have a convention for cropping non-square images
- convert to png
- copy images to
class_data/classname/avatars
folderMore of a UI thing: #15, #16
The text was updated successfully, but these errors were encountered: