function maxscale($file)
 {
     $size = getimagesize($file);
     if ($size[0] > $this->max_scale['x'] || $size[1] > $this->max_scale['y']) {
         if (!class_exists('Bilder')) {
             include_once 'Bilder.php';
         }
         if (!is_writeable($file)) {
             RheinaufFile::chmod($file, '777');
         }
         $img = new Bilder($file, $file);
         if ($size[0] > $this->max_scale['x']) {
             $img->scaleMaxX($this->max_scale['x']);
         } else {
             $img->scaleMaxY($this->max_scale['y']);
         }
         $img->output();
     }
 }