Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ability to import images #2

Open
joshribakoff opened this issue Jul 11, 2013 · 3 comments
Open

Ability to import images #2

joshribakoff opened this issue Jul 11, 2013 · 3 comments

Comments

@joshribakoff
Copy link
Member

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
Copy link
Member Author

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
Copy link

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:
#2 (comment)

@joshribakoff
Copy link
Member Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants