I have a site which has over 50,000 images that need to be Zoomified. Under Drupal the images are stored with a directory per node in a flat directory. There is a hard limit of ~32,000 entries in a Linux ext3 directory. An extra layer of directories is necessary to avoid this issue.

I fixed this with the simple expedient of dividing the nid by 10,000:

--- zoomify.inc.org     2009-07-06 09:05:39.000000000 +0100
+++ zoomify.inc 2011-10-12 18:46:52.000000000 +0100
@@ -29,7 +29,9 @@ function _zoomify_basepath() {
 }
 
 function _zoomify_nodepath($node) {
-  return file_create_path(_zoomify_basepath() .'/'. $node->nid);
+  // > 32000 zoomified nodes breaks on an ext3 filesystem; need another layer
+  $d = intval($node->nid / 10000);
+  return file_create_path(_zoomify_basepath() .'/'. $d .'/'. $node->nid);
 }
 
 function _zoomify_filepath($node, $fid) {

Whilst this may not be the most efficient way to do this, it does provide a workaround for anybody else who hits the same issue.

Comments

infojunkie’s picture

Version: 6.x-1.4 » 6.x-1.x-dev
Status: Active » Fixed

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.