AppDB update (refactoring and new ideas)

Jonathan Ernst Jonathan at ErnstFamily.ch
Sat Dec 18 16:23:43 CST 2004


Hello,

I made a huge patch that (IMHO) cleans up the code structure of the
AppDB and as a side effect, fixes most remaining global vars bugs.

If this patch can be added tonight I'll then improve and fix the
screenshot code (it works, but sometimes there are problems with
backslashing the image content). I found better ways to store images in
mysql but I think it would be even better to put it on the serveur
in /data/screenshots/queued/ they'll have an integer name (appDataQueue
table's id) and the directory listing must not be readable.

I plan to change the way thumbnails are done. On the fly image
generation can be very time consumming and if there are many users in
the futures I think we could achieve much better performances using
one-time thumbnails generation. As you can see I added in the config
file width and height parameters for screenshots so that the algorithm
will look like this:

do we have a thumbnail of the requested size for the requested imageId ?
 - if yes, serve the image
 - if no create a file /data/screenshots/thumbnails/$imageid_$width_
$height.$ext

This solves many problems:
1) less cpu demanding
2) if we change the file size in the config file, new thumbnails will be
made upon request and someone can clean up the thumbnail directory using
rm *_oldWidth_oldHeight.*
3) if two people submit two pictures with the same name (screenshot.png
for example) it won't conflict as the id of the table is used
4) when a screenshot is accepted by an administrator or maintainer we
just copy the file from /data/queued/screenshots and then delete it

If you do think it's clean like this, i'll work on it asap but then
please ask the following to Jeremy if you see him (even if it breaks the
screenshot function for some hours I think it's not a big issue):

1)create /data/queued/screenshots
and /data/queued/screenshots/thumbnails directories (they have to be
writable by the php process)
2)after making sure that no appdata is pending in the admin, issue the
following sql requests:

drop table if exists appDataQueue;
/*
 * links to screenshots and other stuff waiting to be accepted
 */
create table appDataQueue (
 queueid   int not null auto_increment,
 appId    int not null,
 versionId  int default 0,
 type   enum('image', 'url'),
 description  text,
 url    varchar(255),
 userId int not null,
 submitTime  timestamp,
 key(queueid),
 index(appId),
 index(versionId)
);


Thanks a lot for everything, hope you like the patch altough it's huge
(but it works and I couldn't make it much smaller as there are quite
deep implications when moving things around)

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Ceci est une partie de message
	=?ISO-8859-1?Q?num=E9riquement?= =?ISO-8859-1?Q?_sign=E9e?=
Url : http://www.winehq.org/pipermail/wine-devel/attachments/20041218/143314e5/attachment.pgp


More information about the wine-devel mailing list