-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathPicasaDB.txt
112 lines (95 loc) · 3.39 KB
/
PicasaDB.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
# idea: put Picasa in DB (SQLite)!
lpgallery performance as/of 2022/05: 18644 thumbnails generated by
slideshow @ 0.125 seconds: peak 2.4G RAM, .lpdb-thumb.db=522MB,
.lpdb.db=5.1MB. So this is average disk of 29KB/image.
lpgallery performance as/of 2022/09: 19012 thumbnails generated by
slideshow @ 0.125 seconds: peak 0.5G RAM, .lpdb-thumb.db=705MB,
.lpdb.db=5.3MB. So this is average disk of 37KB/image. RAM is down
due to pictures being ints rather than picture objects. Disk might be
up due to ist::Quadratic thumnbails, formerly ist::Box. I tested and
confirmed that quadratic looks better and doesn't even cost more
space.
# ------------------------------------------------------------
# initial notes on the tables needed
# https://www.sqlite.org/
# http://www.sqlitetutorial.net/
# http://zetcode.com/db/sqliteperltutorial/
# ------------------------------------------------------------ from
# https://www.sqlite.org/lang_datefunc.html store all times as INTEGER
# unixepoch from filsystem or exif, then DB can make them readable:
strftime("format", 1092941466, 'unixepoch', 'localtime');
datetime(1092941466, 'unixepoch', 'localtime');
# current time is:
SELECT srftime('%s', 'now');
# ------------------------------------------------------------
# root object is path/to/picture.jpg, indexed for quick lookup
# Question: should filename be PRIMARY KEY in a WITHOUT ROWID table?
# Could be half size and twice as fast, when selecting file paths.
#CREATE TABLE IF NOT EXISTS files(
CREATE TABLE files(
fileid NOT NULL INTEGER PRIMARY KEY, # alias to fast: rowid, oid, _rowid_
filename TEXT UNIQUE NOT NULL,
# FOREIGN KEY(pictureid) REFERENCES pictures(id),
);
CREATE UNIQUE INDEX filenames ON files(filename);
# all pictures have certain attributes, from filesystem or internal
CREATE TABLE pictures(
width INTEGER,
height INTEGER,
bytes INTEGER,
rotation INTEGER, # 0, 90, 180, 270 CW
updated INTEGER, # file timestamp
time INTEGER, # time picture taken
fileid INTEGER,
PRIMARY FOREIGN KEY(fileid) REFERENCES files(fileid),
);
# some pictures have more exif attributes that we might want
CREATE TABLE exif(
caption TEXT,
TAG
);
TAGINFO
tagid
text
META # metadata stored in pictures
'caption' => '',
'tag' => {},
'gps data',
PICASA # metadata stored in .picasa.ini
picture
'updated' => 1433256741, # .picasa.ini timestamp
'stars' => 0, # boolean
'uploads' => 0,
'faces' => 1, # needed? See other tables instead
'albums' => 0,
'face' => {
'5f2912889a37a7e5' => [
'0.547607421875',
'0.174346923828125',
'0.64508056640625',
'0.38092041015625'
]
},
'album' => {},
FACES
picture
faceid
topx, topy, botx, boty # (post-rotate, if needed)
FACEINFO aka CONTACTS
'5cfcd48ce02f6add' => {
'First [Middle] Last;[email protected];' => 60,
'Some Other Name;[email protected];10433123234426691644565' => 2,
'[email protected]_lh,43366f2e8d1709ef' => 101
},
ALBUMS
picture
albumid
ALBUMINFO
'181bcc62d89341d346d0516d07d09082' => {
'location' => blah blah string',
'[email protected]_lh' => '5445974308945881521',
'date' => '2010-03-06T22:43:59-06:00',
'name' => 'name on album',
'token' => '181bcc62d89341d346d0516d07d09082',
'description' => 'description on album'
},