Quote:
Originally Posted by Mr. X
Oh- one more question I had was if the thumbnail blob has to be a .png or if .jpg is also allowed?
|
They are saved as png data.
You can select the data from thumbnails table and and just use or save as .png file, no need for any modification.
Code:
[inigo@inigo eReader]$ sqlite3 global.db
SQLite version 3.6.20
Enter ".help" for instructions
Enter SQL statements terminated with a ";"
sqlite> .schema thumbnails
CREATE TABLE thumbnails (
file_id INTEGER PRIMARY KEY NOT NULL,
thumb_data_mini BLOB,
thumb_data_small BLOB,
thumb_data_medium BLOB,
thumb_data_large BLOB
);
CREATE TRIGGER fki_thumbnails_file_id
BEFORE INSERT ON thumbnails
FOR EACH ROW BEGIN
SELECT RAISE(ROLLBACK, 'insert on table "thumbnails" violates foreign key constraint "file_metadata" (file_id)') WHERE (SELECT file_id FROM file_metadata WHERE file_id = NEW.file_id) IS NULL;
END;
CREATE TRIGGER fku_thumbnails_file_id
BEFORE UPDATE ON thumbnails
FOR EACH ROW BEGIN
SELECT RAISE(ROLLBACK, 'update on table "thumbnails" violates foreign key constraint "file_metadata" (file_id)') WHERE (SELECT file_id FROM file_metadata WHERE file_id = NEW.file_id) IS NULL;
END;
sqlite> select thumb_data_small from thumbnails where file_id == 2515;
�PNG
sqlite>
Iņigo
EDIT: ok, I'm reading carefully now... you asked if jpeg could be used besides png. Sorry.