Working with <a href="https://wideimage.sourceforge.net/" target="_blank">WideImage</a> today to create an image/media management system inside of my application's framework.<br>Do any of you have suggestions for the best way to organize a database schema to reference images in a file system?<br>My current approach is to run sha1_filename on the image to generate a filename, then store the image to the FS in an image folder path above the root.<br>I'm creating two sub folders to house the images based on the sha1_filename, for example:<br>83d8281665383fa968f34a91e7539b947d3a59d1.jpg is stored as<br>IMAGES_ROOT/83/d8/83d8281665383fa968f34a91e7539b947d3a59d1.jpg<br>My current reference table SQL looks something like this:<br>CREATE TABLE IF NOT EXISTS `images` (<br>`id` INT(20) NOT NULL COMMENT 'image id' ,<br>`filename` VARCHAR(255) NOT NULL COMMENT 'relative path to file on FS' ,<br>`size` INT(8) NULL COMMENT 'file size' ,<br>`width` INT(5) NULL ,<br>`height` INT(5) NULL ,<br>`metadata` TEXT NULL COMMENT 'image meta' ,<br>`mime_type` VARCHAR(45) NOT NULL COMMENT 'mime type\n' ,<br>`caption` TEXT NULL COMMENT 'image caption' ,<br>`uploaded_by` INT(5) NULL ,<br>`created` DATETIME NOT NULL ,<br>`modified` DATETIME NULL ,<br>`live` TINYINT(1) NULL DEFAULT 1 COMMENT 'publicly visible?' ,<br>`deleted` TINYINT(1) NULL DEFAULT 0 COMMENT 'shown in listings' ,<br>PRIMARY KEY (`id`) )<br>ENGINE = InnoDB<br>Eventually I'm going to add tags and categories, but that can also be done later.<br>Thoughts?<br> <br><strong>Update 2/26</strong><br>I ended up using <a href="https://phpimageworkshop.com/" target="_blank">PHP Image Workshop</a> instead.<br>Why? It's got a better website and um.. the code is newer.<br>Right now the<a href="https://joejiko.com/photos"> photo gallery</a> isn't finished, but it's up if you're interested.<br><a href="https://joejiko.com/photos"><img class=" alignnone" title="photo feed" alt="" src="https://cdn.joejiko.com/images/f3abfddb2bf26595e7e6c851f207bbaa54f23e4a_m.jpg" width="600" height="953" /></a><br> <br>I've uploaded over 500 photos. Enjoy!