def thumbnails_for_file(relative_source_path, root=None, basedir=None, subdir=None, prefix=None):
 if (root is None):
  root = settings.MEDIA_ROOT
 if (prefix is None):
  prefix = settings.THUMBNAIL_PREFIX
 if (subdir is None):
  subdir = settings.THUMBNAIL_SUBDIR
 if (basedir is None):
  basedir = settings.THUMBNAIL_BASEDIR
 (source_dir, filename) = os.path.split(relative_source_path)
 thumbs_path = os.path.join(root, basedir, source_dir, subdir)
 if (not os.path.isdir(thumbs_path)):
  return []
 files = all_thumbnails(thumbs_path, recursive=False, prefix=prefix, subdir='')
 return files.get(filename, [])

def thumbnails_for_file ( relative_source_path , root = None , basedir = None , subdir = None , prefix = None ) : if ( root is None ) : root = settings . MEDIA_ROOT if ( prefix is None ) : prefix = settings . THUMBNAIL_PREFIX if ( subdir is None ) : subdir = settings . THUMBNAIL_SUBDIR if ( basedir is None ) : basedir = settings . THUMBNAIL_BASEDIR ( source_dir , filename ) = os . path . split ( relative_source_path ) thumbs_path = os . path . join ( root , basedir , source_dir , subdir ) if ( not os . path . isdir ( thumbs_path ) ) : return [ ] files = all_thumbnails ( thumbs_path , recursive = False , prefix = prefix , subdir = '' ) return files . get ( filename , [ ] )
return a list of dictionaries .