I downloaded a very nice PHP file tree program from here\\
[[https://www.abeautifulsite.net/php-file-tree]]\\

The only change I wanted was to put the image sizes with the tree. I found I only had to modify the ''php_file_tree.php'' to get this functionally using both the his ''classic'' and ''jquery'' version.

Even then the only mods are made to the function ''php_file_tree_dir''\\
<code>
function php_file_tree_dir($directory, $return_link, $extensions = array(), $first_call = true) {
 // Recursive function called by php_file_tree() to list directories/files
	
 // Get and sort directories/files
 $Allow = array('image/jpeg','image/png','image/gif');
 if( function_exists("scandir") ) $file = scandir($directory); else $file = php4_scandir($directory);
 natcasesort($file);
 // Make directories first
 $files = $dirs = array();
 foreach($file as $this_file) {
  if( is_dir("$directory/$this_file" ) ) $dirs[] = $this_file; else $files[] = $this_file;
 }
 $file = array_merge($dirs, $files);
	
 // Filter unwanted extensions
 if( !empty($extensions) ) {
  foreach( array_keys($file) as $key ) {
   if( !is_dir("$directory/$file[$key]") ) {
	$ext = substr($file[$key], strrpos($file[$key], ".") + 1); 
	if( !in_array($ext, $extensions) ) unset($file[$key]);
   }
  }
 }
	
 if( count($file) > 2 ) { // Use 2 instead of 0 to account for . and .. "directories"
  $php_file_tree = "<ul";
  if( $first_call ) { $php_file_tree .= " class=\"php-file-tree\""; $first_call = false; }
   $php_file_tree .= ">";
   foreach( $file as $this_file ) {
    if( $this_file != "." && $this_file != ".." ) {
	 if( is_dir("$directory/$this_file") ) {
// Directory
	  $php_file_tree .= "<li class=\"pft-directory\"><a href=\"#\">" . htmlspecialchars($this_file) . "</a>";
	  $php_file_tree .= php_file_tree_dir("$directory/$this_file", $return_link ,$extensions, false);
	  $php_file_tree .= "</li>";
	 } else {
// File
// Get extension (prepend 'ext-' to prevent invalid classes from extensions that begin with numbers)
	  $ext = "ext-" . substr($this_file, strrpos($this_file, ".") + 1); 
	  $link = str_replace("[link]", "$directory/" . urlencode($this_file), $return_link);
	  $php_file_tree .= "<li class=\"pft-file " . strtolower($ext) . "\"><a href=\"$link\">" . htmlspecialchars($this_file);
	  if (in_array(mime_content_type($directory.'/'.$this_file),$Allow)) {
	   $siz=getimagesize($directory.'/'.$this_file);
	   $php_file_tree .= ' '.strval($siz[0]).'x'.strval($siz[1]).' ';
	  }
	 $php_file_tree .= "</a></li>";
	}
   }
  }
  $php_file_tree .= "</ul>";
 }
 return $php_file_tree;
}
</code>

An ''$Allow'' array is created to hold the wanted image mime types, later we check this against the file type and if image, the image size is determined and inserted in the file tree string after the name.