$filename = 'D://WWW/1.jpg';
$p = 5;
// Get new sizes
list($width, $height) = getimagesize($filename);
$newwidth = $width;
$newheight = floor($height / $p);
$last = $height % $p;
// Load
$source = imagecreatefromjpeg($filename);
for( $i=0 ; $i< $p; $i++ ){
	$_p = $newheight*$i;
	if( ( $i + 1 ) == $p )
		$newheight += $last;
	$thumb = ImageCreateTrueColor($newwidth, $newheight);
	imagecopyresized( $thumb, $source, 0, 0, 0, $_p, $newwidth,  $height, $width, $height);
	imagejpeg( $thumb , "./t{$i}.jpg" ,100);
}

将图片平均分成几份。

相关文章:

  • 2021-06-22
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-12-09
  • 2021-12-28
  • 2021-07-22
  • 2022-12-23
猜你喜欢
  • 2021-07-16
  • 2022-12-23
  • 2022-12-23
  • 2021-12-19
  • 2021-06-11
  • 2022-12-23
  • 2021-11-17
相关资源
相似解决方案