/**
  * Returns the absolute path to a given cache entry
  * @param string file (path)
  * @param int width to resize to
  * @param int height to resize to
  * @param int value between 0 and 100 for jpeg; null for any other format
  */
 function get_cached_file($src, $width, $height, $quality)
 {
     $testfile = wpws_ImageUtils::generate_cache_filename($src, $width, $height, $quality);
     $cached_file = null;
     $dh = opendir(WPWS_CACHE_DIR);
     while (($file = readdir($dh)) !== false) {
         if (substr($file, 0, strlen($testfile)) == $testfile) {
             $cached_file = $file;
             break;
         }
     }
     closedir($dh);
     return $cached_file == null ? null : WPWS_CACHE_DIR . "/" . $cached_file;
 }