‘ˆΘ‰ΊŒ³‰ζ‘œƒf[ƒ^

‘Œ³‰ζ‘œƒf[ƒ^[0]400
‘Œ³‰ζ‘œƒf[ƒ^[1]300
‘Œ³‰ζ‘œƒf[ƒ^[2]2
‘Œ³‰ζ‘œƒf[ƒ^[3]width="400" height="300"
‘Œ³‰ζ‘œƒf[ƒ^[bits]8
‘Œ³‰ζ‘œƒf[ƒ^[channels]3
‘Œ³‰ζ‘œƒf[ƒ^[mime]image/jpeg

------------------------------------------------------------

‰ζ‘œƒTƒCƒY•ΟXE•Ϋ‘Ά ‰ζ‘œ‚πk¬E•Ϋ‘Ά

«PHP‚ŏk¬‚΅‚½‰ζ‘œi‰‘F200 cF150j


Œ³‰ζ‘œi‰‘F400 cF300j


------------------------------------------------------------

‘ˆΘ‰Ίƒ\[ƒX

$in = ImageCreateFromJPEG("./img/shizen.jpg"); // Œ³‰ζ‘œ
$size = GetImageSize("./img/shizen.jpg"); // Œ³‰ζ‘œ‚ΜƒTƒCƒYŽζ“Ύ
$yoko = $size[0];
$tate = $size[1];
$width = $yoko / 2; // Ά¬‰ζ‘œƒTƒCƒYi‰‘j
$height = $tate / 2; // Ά¬‰ζ‘œƒTƒCƒYicj
$out = ImageCreate($width, $height); // ‰ζ‘œΆ¬
ImageCopyResized($out,$in,0,0,0,0,$width,$height,$size[0],$size[1]); // ƒTƒCƒY•ΟX
ImageJPEG($out, "./imgs/shizens.jpg"); // ‰ζ‘œ•Ϋ‘Ά
ImageDestroy($in);
ImageDestroy($out);

‘ˆΘ‰ΊŒ³‰ζ‘œƒf[ƒ^
foreach($size as $keys => $value){
echo '‘Œ³‰ζ‘œƒf[ƒ^['.$keys.']'.$value.'';
}