For large sites, it would be nice if one could have different directories per node as a directory with thousands of images becomes unusable.
Any chance that something like this will be implemented?

Comments

hutch’s picture

Imagepicker works per user, not per node. Each user gets their own directory under a directory using the first letter of their name, eg files/imagepicker/n/nath where the main images are kept. Thumbnails are kept under files/imagepicker/n/nath/thumbs and the thumbnails used in the browser are kept in files/imagepicker/n/nath/browser.
The image browser is paged and there are groups that can be created to make finding files easier.
The files per directory limit depends on the type of filesystem deployed.
See http://en.wikipedia.org/wiki/Comparison_of_file_systems for more information on filesystem capacities.

I hope this answers your question.

nath’s picture

Yes, thanks But it would still be nice to have the option of having per node directories, for example for sites where multiple users work on the same node.

hutch’s picture

I think that would make it a different kind of module. The file storage and ownership concepts are mutually incompatible so it would have to be either one or the other.
A node, say a 'story' would have to be created by a user first in order to generate a node id. Once that exists the image handling module could create a directory for that node's images, eg files/imagepicker/99. From that point on any other users with role permissions for 'edit story content' would be able to access that node to edit it, as well of course access all 'story' nodes in the database.
A way to make imagepicker aware of the current node id would have to be found, at the moment it lives independently of the node, the box that imagepicker appears in is an iframe, unconnected to the form displaying the node. The imagepicker table would have to be changed too. My guess is that this would have to be what is known in drupalese as a 'node module' which imagepicker is not. The image module is a node module but it stores each image as a separate node which is different again.
So to sum up this is not an option that can be just added on, it's a new module, probably doable but quite different 'under the hood'.

hutch’s picture

Status: Active » Closed (fixed)