What image information is considered a good idea to store in a MySQL database for example? -
i going store images in folders , not in database. information images stored in database. image table looks this:
drop table if exists database.image; create table if not exists database.image ( id int(11) unsigned not null auto_increment primary key, filename varchar(255) not null, extension varchar(10) not null, created int(11) unsigned not null, user_id int(11) unsigned not null, deleted int(1) not null default 0 ) character set utf8; alter table database.image add index (user_id);
is there point of saving example size of image future? or maybe storing dimensions idea? considered worth saving information future in image table this?
i need store kind of thumbnails too. input appreciated.
the data save should depend on how plan use data in future.
if need show list of images sorted name filename enough.
in case want add advanced image filtration in future i.e. filter images list size, type, dimensions reasonable extract these information image when create , store db.
thumbnails generated @ stage when create image. add thumbnail name database if need refer in application.
i think practice not store path in database. i.e. don't store path image /var/www/public/uploads/myimage.jpg . in case if move server web site located @ /home/cheaphosting/public have problems. save either filename or related path db , configure absolute path in application.
Comments
Post a Comment