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

Discuss the database features

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

Postby Steve R. » Tue Aug 24, 2010 10:20 pm

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
Steve R.
 
Posts: 162
Joined: Mon Sep 21, 2009 12:06 am
Location: Morehead City, North Carolina

Re: Best Approach for Images - Store or Link?

Postby Villeroy » Tue Aug 24, 2010 10:46 pm

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, no OpenOffice, LibreOffice 6.x
User avatar
Villeroy
Volunteer
 
Posts: 27386
Joined: Mon Oct 08, 2007 1:35 am
Location: Germany

Re: Best Approach for Images - Store or Link?

Postby Steve R. » Wed Aug 25, 2010 1:56 am

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
Steve R.
 
Posts: 162
Joined: Mon Sep 21, 2009 12:06 am
Location: Morehead City, North Carolina

Re: Best Approach for Images - Store or Link?

Postby Villeroy » Wed Aug 25, 2010 7:23 pm

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 1636 times
Please, edit this topic's initial post and add "[Solved]" to the subject line if your problem has been solved.
Ubuntu 18.04, no OpenOffice, LibreOffice 6.x
User avatar
Villeroy
Volunteer
 
Posts: 27386
Joined: Mon Oct 08, 2007 1:35 am
Location: Germany

Re: Best Approach for Images - Store or Link?

Postby Steve R. » Thu Nov 04, 2010 4:33 am

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
Steve R.
 
Posts: 162
Joined: Mon Sep 21, 2009 12:06 am
Location: Morehead City, North Carolina

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

Postby Villeroy » Thu Nov 04, 2010 10:13 pm

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, no OpenOffice, LibreOffice 6.x
User avatar
Villeroy
Volunteer
 
Posts: 27386
Joined: Mon Oct 08, 2007 1:35 am
Location: Germany


Return to Base

Who is online

Users browsing this forum: No registered users and 3 guests