src/bbn/file/image.php
public function thumbs($dest = '.', $sizes = [[false, 960], [false, 480], [false, 192], [false, 96], [false, 48]], $mask = '_%s', $crop = false, $bigger = false){
		if ( $this->test() && is_dir($dest) ){
      $this->get_extension();
			$w = $this->get_width();
			$h = $this->get_height();
			$d = $w >= $h ? 'w' : 'h';
      $res = [];
      if ( bbn\str::is_integer($sizes) ){
        $sizes = [[$sizes, false]];
      }
			if ( $$d / ($d === 'w' ? $h : $w) < 5 ){
				$mask = ($dest === '.' ? '' : $dest.'/').$this->title.$mask.'.'.$this->ext;
        //die(var_dump($mask));
				foreach ( $sizes as $s ){
          if ( bbn\str::is_integer($s) ){
            $s = [$s, false];
          }
          if (
            (!empty($s[0]) && ($w > $s[0])) ||
            (!empty($s[1]) && ($h > $s[1])) ||
            $bigger
          ){
            $smask = (empty($s[0]) ? '' : 'w'.$s[0]).(empty($s[1]) ? '' : 'h'.$s[1]);
            $fn = sprintf($mask, $smask);
            if ( $s[0] && $s[1] ){
              if ( $crop ){
                $this->resize($s[0], $s[1], true);
              }
              else{
                $this->resize($d === 'w' ? $s[0] : false, $d === 'h' ? $s[1] : false, false, $s[0], $s[1]);
              }
            }
            else{
              $this->resize($s[0], $s[1], $crop);
            }
            $this->save($fn);
            $res[$smask] = $fn;
          }
				}
				return $res;
			}
		}
    return false;
	}
public function thumbs($dest = '.', $sizes = [[false, 960], [false, 480], [false, 192], [false, 96], [false, 48]], $mask = '_%s', $crop = false, $bigger = false){
		if ( $this->test() && is_dir($dest) ){
      $this->get_extension();
			$w = $this->get_width();
			$h = $this->get_height();
			$d = $w >= $h ? 'w' : 'h';
      $res = [];
      if ( bbn\str::is_integer($sizes) ){
        $sizes = [[$sizes, false]];
      }
			if ( $$d / ($d === 'w' ? $h : $w) < 5 ){
				$mask = ($dest === '.' ? '' : $dest.'/').$this->title.$mask.'.'.$this->ext;
        //die(var_dump($mask));
				foreach ( $sizes as $s ){
          if ( bbn\str::is_integer($s) ){
            $s = [$s, false];
          }
          if (
            (!empty($s[0]) && ($w > $s[0])) ||
            (!empty($s[1]) && ($h > $s[1])) ||
            $bigger
          ){
            $smask = (empty($s[0]) ? '' : 'w'.$s[0]).(empty($s[1]) ? '' : 'h'.$s[1]);
            $fn = sprintf($mask, $smask);
            if ( $s[0] && $s[1] ){
              if ( $crop ){
                $this->resize($s[0], $s[1], true);
              }
              else{
                $this->resize($d === 'w' ? $s[0] : false, $d === 'h' ? $s[1] : false, false, $s[0], $s[1]);
              }
            }
            else{
              $this->resize($s[0], $s[1], $crop);
            }
            $this->save($fn);
            $res[$smask] = $fn;
          }
				}
				return $res;
			}
		}
    return false;
	}
public function thumbs ( $ dest = '.' , $ sizes = [ [ false , 960 ] , [ false , 480 ] , [ false , 192 ] , [ false , 96 ] , [ false , 48 ] ] , $ mask = '_%s' , $ crop = false , $ bigger = false ) { if ( $ this -> test ( ) && is_dir ( $ dest ) ) { $ this -> get_extension ( ) ; $ w = $ this -> get_width ( ) ; $ h = $ this -> get_height ( ) ; $ d = $ w >= $ h ? 'w' : 'h' ; $ res = [ ] ; if ( bbn \ str :: is_integer ( $ sizes ) ) { $ sizes = [ [ $ sizes , false ] ] ; } if ( $ $ d / ( $ d === 'w' ? $ h : $ w ) < 5 ) { $ mask = ( $ dest === '.' ? '' : $ dest . '/' ) . $ this -> title . $ mask . '.' . $ this -> ext ; //die(var_dump($mask)); foreach ( $ sizes as $ s ) { if ( bbn \ str :: is_integer ( $ s ) ) { $ s = [ $ s , false ] ; } if ( ( ! empty ( $ s [ 0 ] ) && ( $ w > $ s [ 0 ] ) ) || ( ! empty ( $ s [ 1 ] ) && ( $ h > $ s [ 1 ] ) ) || $ bigger ) { $ smask = ( empty ( $ s [ 0 ] ) ? '' : 'w' . $ s [ 0 ] ) . ( empty ( $ s [ 1 ] ) ? '' : 'h' . $ s [ 1 ] ) ; $ fn = sprintf ( $ mask , $ smask ) ; if ( $ s [ 0 ] && $ s [ 1 ] ) { if ( $ crop ) { $ this -> resize ( $ s [ 0 ] , $ s [ 1 ] , true ) ; } else { $ this -> resize ( $ d === 'w' ? $ s [ 0 ] : false , $ d === 'h' ? $ s [ 1 ] : false , false , $ s [ 0 ] , $ s [ 1 ] ) ; } } else { $ this -> resize ( $ s [ 0 ] , $ s [ 1 ] , $ crop ) ; } $ this -> save ( $ fn ) ; $ res [ $ smask ] = $ fn ; } } return $ res ; } } return false ; }
Creates miniature of the image

```php
$img = new bbn\file\image("/home/data/test/image.jpg");
$img->thumbs()->save(/home/data/test/image_test.jpg");
```

@return image|false
Creates miniature of the image