[Solved] Best Approach for Images - Store or Link?

Discuss the database features
Post Reply
User avatar
Steve R.
Posts: 163
Joined: Mon Sep 21, 2009 12:06 am
Location: Morehead City, North Carolina

[Solved] Best Approach for Images - Store or Link?

Post by Steve R. »

Last night I figured out how to store an image into BASE. The images are of magazine covers. The covers change as your form goes from one issue to the next. In MS Access the recommend approach is to LINK to the image so that it is NOT stored in the database itself. Storing pictures in MS Access causes extensive database bloat.

I am very slowly converting my MS Access database to BASE. My question, in BASE, which is the recommended approach for storing images. Within the database itself or through a link to an external image file?
Last edited by Hagar Delest on Thu Nov 04, 2010 9:22 am, edited 1 time in total.
Reason: tagged [Solved].
Ubuntu 16.04 and Windows 10
User avatar
Villeroy
Volunteer
Posts: 31269
Joined: Mon Oct 08, 2007 1:35 am
Location: Germany

Re: Best Approach for Images - Store or Link?

Post by Villeroy »

Link the images and bind a form's picture control to a text field containing the relative file-URLs.
Easiest way:
Avoid all special chars and spaces in picture file names.
(Linux shell)$ ls -1 *.png > pics.txt [drops all png files in this directory as a single column in file pics.txt]
Link the text file to a text table: [Tutorial] Using csv/text files as editable data source. which should work with most database engines, including HSQL.
Put the odb-database in the same directory as the pics.txt and the pictures, so you don't need any path.
Link the file names to some other tables. Use relations and edit them through list boxes so you can associate the file names with other data.
Create the form(s)
Another ls -1 *.png>pics.txt updates the list of pictures.
Please, edit this topic's initial post and add "[Solved]" to the subject line if your problem has been solved.
Ubuntu 18.04 with LibreOffice 6.0, latest OpenOffice and LibreOffice
User avatar
Steve R.
Posts: 163
Joined: Mon Sep 21, 2009 12:06 am
Location: Morehead City, North Carolina

Re: Best Approach for Images - Store or Link?

Post by Steve R. »

Thanks. The guidance should prove useful. Importing the data from MS Access wasn't too bad, but its going to be slow getting it running under BASE. Good learning experience.
A post on my project is located here: Analog Science Fiction And Fact Database
Ubuntu 16.04 and Windows 10
User avatar
Villeroy
Volunteer
Posts: 31269
Joined: Mon Oct 08, 2007 1:35 am
Location: Germany

Re: Best Approach for Images - Store or Link?

Post by Villeroy »

Before someone asks for it, here is another example db with a data flow
Shell command listing file names to >pics.txt >linked HSQL-table named "pics" >one-to-many relation to "Table1" >bound column of the form's picture control
[plus an additional index which prevents using the same picture twice]

All the details are documented in the form
Attachments
picture_links.zip
Pics linked through file listing.
(138.73 KiB) Downloaded 2230 times
Please, edit this topic's initial post and add "[Solved]" to the subject line if your problem has been solved.
Ubuntu 18.04 with LibreOffice 6.0, latest OpenOffice and LibreOffice
User avatar
Steve R.
Posts: 163
Joined: Mon Sep 21, 2009 12:06 am
Location: Morehead City, North Carolina

Re: Best Approach for Images - Store or Link?

Post by Steve R. »

Yea!! :D Finally got around to experimenting with this. Developed a test database and followed the directions. It worked.
It will still be challenge incorporating it into my "real" database, but a least I know that linking to images is workable.
Thanks very much for the help.
Ubuntu 16.04 and Windows 10
User avatar
Villeroy
Volunteer
Posts: 31269
Joined: Mon Oct 08, 2007 1:35 am
Location: Germany

Re: [Solved] Best Approach for Images - Store or Link?

Post by Villeroy »

Thank you very much for this late feedback. I'm glad that you found your way through the jungle.
Please, edit this topic's initial post and add "[Solved]" to the subject line if your problem has been solved.
Ubuntu 18.04 with LibreOffice 6.0, latest OpenOffice and LibreOffice
Post Reply