Multimedia data should be store within database

Bug #1953684 reported by Stefan Rebacz
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Pigeon Planner
Confirmed
Wishlist
Timo Vanwynsberghe

Bug Description

Hello,

It is bad idea to keep multimedia data outside the database. Right now, the pigeon planner stores image data as hard-coded paths for example "~/pictures/pigeons/1.png". Once you format your hard drive and reinstall computer and then restore the backup data of PigeonPlanner the multimedia will do not work until you copied your resource to the same directory structure. If you migrate from Linux to Windows it will never happened. In the same time you will experience strange errors when image data doesn't exist. I had recently critical error. If I managed to reproduce I will put stack trace in this thread.

To fix that problem PigeonPlanner:
- should make copy of the image and put it in database
- all images should be displayed from database data, not images from disk

The main disadvantage of this approach is that the size of the database will be bigger, but you could store compressed image data. But, basing on the current hardware specification it is not the problem. 512 GB SSD is no standard, so let's assume that you have 100 pigeons and each image weights 3Mb. The overall database weight will increase by 300 Mb. In brief, this is relatively low cost for the atomic stability.

You could also consider this as an option, however it should be enable by everyone by default.

Regards,
Stefan

Revision history for this message
Timo Vanwynsberghe (timovwb) wrote :

Hey Stefan, perfect timing. It's on my ToDo list for the next version.

There's two possible solutions:
 1. store the images itself in the database (like you suggest)
 2. copy the images to a dedicated directory and store that path in the database

Point 1 will be the easiest solution. Everything sits nicely in the database, backups and moving the database will be seamless. But last time I checked it wasn't really advised to store images in the database itself. And what about other posible media files ("Media" tab at the bottom)?

Point 2 is currently my choice, but has some drawbacks. The program will have to manage these files (addition, deletion, duplicates), link it to the database, include in backups, ...

I'm not a database expert, so any input from others is welcome.

Changed in pigeonplanner:
assignee: nobody → Timo Vanwynsberghe (timovwb)
importance: Undecided → Wishlist
milestone: none → 4.4.0
status: New → Confirmed
Revision history for this message
Stefan Rebacz (stefanreb) wrote :

Hello Timo,

After quick googling your approach with storing copy of images on disk is correct (https://stackoverflow.com/questions/3748/storing-images-in-db-yea-or-nay).

Stefan

Revision history for this message
Timo Vanwynsberghe (timovwb) wrote :

I have to push this to the next release. I've not been able to work on Pigeon Planner for a while and this feature was holding back a new release with some minor new features.

Changed in pigeonplanner:
milestone: 4.4.0 → 4.6.0
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.