Closed Toxantron closed 7 years ago
I do not like this hash folder structure. That makes the saving and loading unnecessarily complicated. The format is not readable by any editor/explorer or something else. ´
I prefer to use a more human readable sturcture.
uploads id/name/datetime-original.ext id/name/datetime-thumb.ext id/name/datetime-slideshow.ext id/name/datetime-metadata.json
The json is human readable and is easy to handle in code.
I love it, it's fast, space saving and why does it have to be human readable? We need an export function anyway. It also allows us to put images and metadata on different partitions.
Most importantly it is fully wrapped in the imagemanager and hidden to the external API. They simply call /image/resized/(Id)
We could argue to use JSON for metadata.
We can even drop the fixed names and instead use resolution pointers like
{
"Width": 1920,
"Height": 1080,
"Reference": "C4E667..."
}
The we only have the original and an array of preprocessed resolutions.
Sounds good! Do you will implement that?
Yes
Closed by #25.
Currently @dbeuchler and I keep switching between timestamped files like 20170301-072931.jpg and GUIDs.
I am not a fan of guids and would personally prefer files names that have some use to the user later - e.g. for sorting a directory. There is a reason all cellphones use timestamps as names. If we decide to use non-time names may I suggest using hashvalues instead. They at least help remove duplicates and are mathematically equally distributed which could help us use the git file-system optimization of using the first two digits of the hash as a subdirectory and the rest as the name.