metator / application

A unit tested shopping cart application
http://metator.com
3 stars 0 forks source link

Ability to import images #2

Open joshribakoff opened 11 years ago

joshribakoff commented 11 years ago

Should have an images column.

User can put an path: absolute path to the image a remote URL to download *or a relative path to the project root

Or the user can use the sha1 hash of an existing image, or the first 8 characters of an existing image, ala git commit hashes.

Multiple images separated by comma. Prefixing an image with a minus sign instructs the system to unlink that image (must store the original filename of the image before its renamed to the hash, so they can remove it by referencing its original filename). It doesn't matter if two image hashes are referenced by the same original filename because its not deleting the image off disk, its just unlinking the image from that particular product. If it unlinks two images from that product because they had the same original filename, its whatever... just make sure we notify the user that that happened. They can always restore the unlinked image.

joshribakoff commented 11 years ago

So to bypass PHP when serving the images, we could create symlinks for the aliases. There would be a symlink called foo.jpg that points to the hash, this way we don't have to ask the database what foo.jpg points to.

kylecannon commented 11 years ago

But then what's going to manage the symlinks if you don't want to use it anymore later on? — Sent from Mailbox for iPhone

On Sun, Aug 11, 2013 at 11:00 AM, Josh Ribakoff notifications@github.com wrote:

So to bypass PHP when serving the images, we could create symlinks for the aliases. There would be a symlink called foo.jpg that points to the hash, this way we don't have to ask the database what foo.jpg points to.

Reply to this email directly or view it on GitHub: https://github.com/metator/application/issues/2#issuecomment-22461985

joshribakoff commented 11 years ago

garbage collection will help locate & clean up "orphaned symlinks"