Application:Domestic Photo Database

Applications, Games, Tools, User libs and useful stuff coded in PureBasic
collectordave
Addict
Addict
Posts: 1309
Joined: Fri Aug 28, 2015 6:10 pm
Location: Portugal

Application:Domestic Photo Database

Post by collectordave »

Digital cameras are great but they seem to generate hundreds of photos.

Finaly getting round to organising them after my wife asked me to find one photo which had the grandchildren on from around 2006.

About three thousand photos on the computer and no search. So developed this little database.

No help file as yet.

It starts by allowing you to add a subject for the photo this is just a really general title such as christmas or Holiday. Photo content can then be added, I use content to say what is in the picture all the childrerns names etc places we have visited and generally anything which appears on the photo.

Once these are entered Photos can be added to the database.

Click the add button then select the photo, subject and enter the date only the year and month are significant here at the moment then click ok. After this a thumbnail image of the photo is added to the database and a folder is created as a sub folder from where the application is run which has as a name made up of the year,month and subject the photo is then either moved to this folder or copied to this folder depending on the settings in preferences.

Once added as much content entered earlier can be added as you wish. You can also add more descriptive content as you go along to add to a photo.

Now as it grows and you are asked to find a photo you can search the database on Subject,content, year and month.

Once some photos are selected you can display full screen a single photo or have a fullscreen slide show of the selected photos.

It is available here, https://github.com/collectordave/PureBa ... c-Photo-DB

I will start writing a help file soon if needed and add to the link.

It works in English, french, German and Italian.

Enjoy

cd
Last edited by collectordave on Sat Jan 21, 2017 10:51 am, edited 1 time in total.
Any intelligent fool can make things bigger and more complex. It takes a touch of genius — and a lot of courage to move in the opposite direction.
GoodNPlenty
Enthusiast
Enthusiast
Posts: 107
Joined: Wed May 13, 2009 8:38 am
Location: Arizona, USA

Re: Domestic Photo Database

Post by GoodNPlenty »

I can't believe how many photos I have accumulated over time and the hours spent searching when I need one. Nicely done, Thank You for sharing :D
User avatar
Fangbeast
PureBasic Protozoa
PureBasic Protozoa
Posts: 4747
Joined: Fri Apr 25, 2003 3:08 pm
Location: Not Sydney!!! (Bad water, no goats)

Re: Domestic Photo Database

Post by Fangbeast »

At one stage, I had over 300,000 photos and I wrote a photo database as well (Never thought about the slideshow part) but it was far too much work for so many photos. Too much to keep track of and I never, ever looked at them.

Solved the problem by ditching everything except the family photos and now down to 2,000 or so.

Amazing what spring cleaning can do for you.
Amateur Radio, D-STAR/VK3HAF
collectordave
Addict
Addict
Posts: 1309
Joined: Fri Aug 28, 2015 6:10 pm
Location: Portugal

Re: Domestic Photo Database

Post by collectordave »

Spring cleaning as I go along.

Made mistake this christmas bought wife large SD card so quite a lot to add. Thinking about a batch import so a whole folder can be imported in one go. If anyone else wants that then I will make it a priority if not it will come along eventually.

Kind regards

cd
Any intelligent fool can make things bigger and more complex. It takes a touch of genius — and a lot of courage to move in the opposite direction.
collectordave
Addict
Addict
Posts: 1309
Joined: Fri Aug 28, 2015 6:10 pm
Location: Portugal

Re: Application:Domestic Photo Database

Post by collectordave »

Printing of single photos or thumbnails of selected images now included. Courtesy of CDPrint.pbi which can be found here
http://www.purebasic.fr/english/viewtop ... 12&t=67703.

The link in the first post has now been updated with the new bits added on github.

Kind regards

cd
Any intelligent fool can make things bigger and more complex. It takes a touch of genius — and a lot of courage to move in the opposite direction.
User avatar
netmaestro
PureBasic Bullfrog
PureBasic Bullfrog
Posts: 8425
Joined: Wed Jul 06, 2005 5:42 am
Location: Fort Nelson, BC, Canada

Re: Application:Domestic Photo Database

Post by netmaestro »

Useful, thanks for sharing :mrgreen:
BERESHEIT
User avatar
Blue
Addict
Addict
Posts: 864
Joined: Fri Oct 06, 2006 4:41 am
Location: Canada

Re: Application:Domestic Photo Database

Post by Blue »

Missing variable app::ThumbSize ?

I couldn't find it in the app.pbi file.
"That's not a bug..." said the programmer. "it's a feature! "
"Oh! I see..." replied the blind man.
collectordave
Addict
Addict
Posts: 1309
Joined: Fri Aug 28, 2015 6:10 pm
Location: Portugal

Re: Application:Domestic Photo Database

Post by collectordave »

Hi Blue

You can add the line

Global ThumbSize.i

Should be about line 19 in App.pbi after

;Application Variables For Preferences

I have also updated github link in first post so you can download App.pbi again from that source.

Cheers

cd
Any intelligent fool can make things bigger and more complex. It takes a touch of genius — and a lot of courage to move in the opposite direction.
User avatar
Blue
Addict
Addict
Posts: 864
Joined: Fri Oct 06, 2006 4:41 am
Location: Canada

Re: Application:Domestic Photo Database

Post by Blue »

Thanks for the quick reply.
I'm surprised that this was not caught before now.
Surely nobody who tested your app before today (not even you, in fact) could get it to run with missing variable, especially considering that you're in the (good) habit of using the explicit directive.
"That's not a bug..." said the programmer. "it's a feature! "
"Oh! I see..." replied the blind man.
User avatar
Blue
Addict
Addict
Posts: 864
Joined: Fri Oct 06, 2006 4:41 am
Location: Canada

Re: Application:Domestic Photo Database

Post by Blue »

Hi collectordave.

Also missing : SelectImage.png (line 924 of WinMain)

Until you locate and provide the correct one, i'm simply using a copy of Add.png as SelectImage.png.

So far I haven't been lucky trying to discover your application.
Pressing the Preferences toolbar button sends your app into nowhere land, never to return.
Also, the window is chopped off at the bottom, so that one can only guess that something more is down there, but what ?

I'll keep plugging at it, since I very much like your idea.
So far, however, it hasn't been very convincing (which isn't saying that it lacks in promises.)
Obviously you've worked hard on this, but a little more appears to be required.

One question, though, before i let you go :
When speaking to people, you don't say "if it rains today is true, bring an umbrella".
I'll bet you say something more like "if it rains today, bring an umbrella."
So why then do you code

Code: Select all

If AddPhoto::OkPressed = #True
...
EndIf
rather than simply

Code: Select all

If AddPhoto::OkPressed
...
EndIf
To me that's a lot clearer and cleaner, therefore more natural.
Last edited by Blue on Thu Mar 02, 2017 6:38 am, edited 3 times in total.
"That's not a bug..." said the programmer. "it's a feature! "
"Oh! I see..." replied the blind man.
collectordave
Addict
Addict
Posts: 1309
Joined: Fri Aug 28, 2015 6:10 pm
Location: Portugal

Re: Application:Domestic Photo Database

Post by collectordave »

Hi blue

Thanks for finding that little quirk.

It was only added a month ago when I added the printing of photos and thumbnails. I concentrated so much on getting the new main win prog and the print module onto github I probably missed it.

I do not even imagine that many people download my little applications. So it is good to hear that someone does.

Regards

cd
Any intelligent fool can make things bigger and more complex. It takes a touch of genius — and a lot of courage to move in the opposite direction.
User avatar
Blue
Addict
Addict
Posts: 864
Joined: Fri Oct 06, 2006 4:41 am
Location: Canada

Re: Application:Domestic Photo Database

Post by Blue »

Hello collectordave.
collectordave wrote:I do not even imagine that many people download my little applications.
Well, as I said in a previous message, some people like the idea. :shock:
So I'm glad that pleases you.

I'll just keep digging into it until you get it to work to my satisfaction.
Which will most likely end up being to your satisfaction as well. :wink:

I forgot to ask, and to tell :
What system are you working under, and what version of PB are you using ?
I'm currently using PB 5.6b8X64 on Windows 10 X64.
"That's not a bug..." said the programmer. "it's a feature! "
"Oh! I see..." replied the blind man.
User avatar
Blue
Addict
Addict
Posts: 864
Joined: Fri Oct 06, 2006 4:41 am
Location: Canada

Re: Application:Domestic Photo Database

Post by Blue »

Hi again collectordave.

mystery of vanishing main window when calling Preferences dialog: solved !

constants in WinMain.pb :

Code: Select all

;Main Menu Enumeration
Enumeration 50  ;MainForm
  ;Main Window
  #WinMain
   ...
EndEnumeration
constants in dlgPreferences.pbi :

Code: Select all

Enumeration 50        ; <<<< culprit : this starting value MUST be different 
  #winPreferences     ; <<<< oops... problem : same constant value for 2 different windows.
  ...
EndEnumeration
The main dialog and the preferences dialog end up having the same id number.
Do you see it ?

In fact you have a lot of constants with different names, but the same value.
Here's the current situation, with suggested modifications, using your list of included files in WinMain :

Code: Select all

;Include Files
IncludeFile "Locale.pbi"
IncludeFile "App.pbi"
IncludeFile "DCTool.pbi"
IncludeFile "ImageViewer.pbi"         ; enum 300       2 constants    suggestion : enum 10 
IncludeFile "dlgPreferences.pbi"      ; enum 50       14 constants    suggestion : enum 15   
IncludeFile "dlgSelectDate.pbi"       ; enum 350       4 constants    suggestion : enum 30
IncludeFile "dlgAddPhoto.pbi"         ; enum 300      11 constants    suggestion : enum 35
IncludeFile "dlgNewSubject.pbi"       ; enum 300       4 constants    suggestion : enum 50
IncludeFile "dlgEditSubject.pbi"      ; enum 300       4 constants    suggestion : enum 55
IncludeFile "dlgDeleteSubject.pbi"    ; enum 300       4 constants    suggestion : enum 60
IncludeFile "dlgNewContent.pbi"       ; enum 300       4 constants    suggestion : enum 65
IncludeFile "dlgEditContent.pbi"      ; enum 300       5 constants    suggestion : enum 70
IncludeFile "dlgDeleteContent.pbi"    ; enum 300       4 constants    suggestion : enum 80
IncludeFile "dlgSearch.pbi"           ; enum 400       4 constants    suggestion : enum 85
IncludeFile "dlgAddContent.pbi"       ; enum 300      11 constants    suggestion : enum 90
IncludeFile "CDPrint.pbi"             ; enum (none)    4 constants    suggestion : enum 105
;             WinMain.pb              ; enum 50       53 constants    suggestion : enum 110
I'm sure the many identical values don't, for most of them, create any problem, but using different values to start with guarantees you won't have any problem.
"That's not a bug..." said the programmer. "it's a feature! "
"Oh! I see..." replied the blind man.
collectordave
Addict
Addict
Posts: 1309
Joined: Fri Aug 28, 2015 6:10 pm
Location: Portugal

Re: Application:Domestic Photo Database

Post by collectordave »

Hi blue

Seen that before thanks.

Most of them have no conflict as they are displayed as modal dialogs so only one can be present at any one time.

Point taken though best to be sure. My problem is how high can I go with numbering when using enumerations so as not to conflict with any PB constants?

I will change the enumeration for the preferences dialog and repost when done.

Regards

cd

ps I notice you have posted on the vectoricons post of little john have you tried the vectoricon designer?
Any intelligent fool can make things bigger and more complex. It takes a touch of genius — and a lot of courage to move in the opposite direction.
User avatar
Bisonte
Addict
Addict
Posts: 1226
Joined: Tue Oct 09, 2007 2:15 am

Re: Application:Domestic Photo Database

Post by Bisonte »

To solve this and future collisions use the enumeration value like this :

Code: Select all

Enumeration EnumWindows 1 ; <-- we start with number One
  #Window_Main
EndEnumeration

; Other includefiles

Enumeration EnumWindows ; <-- no givin' number so it counts....
  #Window_Preferences
EndEnumeration

Debug #Window_Main        ; > 1
Debug #Window_Preferences ; > 2
So you don't must remember, what you set before ;)
PureBasic 6.04 LTS (Windows x86/x64) | Windows10 Pro x64 | Asus TUF X570 Gaming Plus | R9 5900X | 64GB RAM | GeForce RTX 3080 TI iChill X4 | HAF XF Evo | build by vannicom​​
English is not my native language... (I often use DeepL to translate my texts.)
Post Reply