Open almet opened 2 years ago
We can't store the image as it is in postgres or sqllite right? Currently I had the same requirement and i am storing it as a blob in the DB, and it is highly NOT recommended for performance reasons
I think we would need to store the pictures on the host, as files.
This sounds good, but some hosts, like heroku delete the extra files created periodically. If this won't be an issue, then that would be good👍
In my work we are storing video surveillance images in small SQLite database, one for each camera and each minute. It can be up to 6 fps, so 360 JPEG images are stored in SQLite. This is not a big database, but we explicitly chose that option instead of many files, because of the I/O caused by metadata. I/O load dropped by 70% using SQLite database instead of individuals files.
I think we are here in a completely different goal, but as far as I experienced, storing blob into database is not that bad. They should be stored in their own table, at least. I added that because, if the need for a writable directory is difficult, database can be an option.
Neat, that seem to be the easy path forward.
I have one project which stores blobs into DB. You can check it out here
https://github.com/shrn01/code-red
I'm using SQLAlchemy as an ORM, so it's straight forward to store the blob
I'm not convinced about this use-case. As the original reporter said, and as our documentation highlights, Ihatemoney is designed for "high-trust" environments.
Maybe I can share my usecase. I use ihatemoney at home with 5 other people. Until last year we were on another similar project, for 10 years. We used to upload bill scans, and this is indeed something we miss with IHM. There is no trust issue between us, but we want to be able to check for human errors on distribution. For example, if you get assigned to a bill for a meal where you were actually absent, the bill helps remember when was the meal and what was eaten.
This becomes even more useful when features like #471 is implemented. Someone bought common food, including some meat and put you on the bill, however you were absent for the very meal where the meat was eaten. Here you can check how must cost the meat and adjust the distribution so you don't pay for the meat.
I was opposed to it, and then had the use case myself a few years back. Rather than keeping the tickets somewhere around at my place, it seems to make sense to have them uploaded in IHM. So, for me it's a +1 for this feature.
Ok, that can indeed make sense.
If we add that feature, it should not become a big burden for IHM server administrators. In my opinion, that means:
UX-wise, it's very similar to the existing "external link" feature, so it can be handled the same way (hidden under the same "More options" button)
Does that sound reasonable?
There is one point that needs UX design, though: how to display back this data in the list of bills?
If it's an image, it could be display on hover or in a modal.
If it's a PDF, then maybe a download button would be better.
Hello! Up on the file upload? How could we help on this?
From Michiel Leenaars, by email.
We currently have an option to attach links in the form of URLs, but it doesn't support file uploads on its own.
We would do this this way (summary of the discussions):
We don't want to shrink the images before upload.