1

PHP で 300ppi で画像を作成できる方法はありますか? GD ライブラリのドキュメントを見ましたが、情報が見つかりません。画像を処理してppiを設定できる方法はありますか?

あるいは、画像の解像度を変換するフラッシュで利用できる方法はありますか?

ありがとう

マニ

4

1 に答える 1

2

使用できるサンプルコードは次のとおりです。

imagejpeg($image, $file, 75);

// Change DPI
$dpi_x   = 300;
$dpi_y   = 300;

$image   = file_get_contents($file);

// Update DPI information in the JPG header
$image[13] = chr(1);
$image[14] = chr(floor($dpi_x/255));
$image[15] = chr($dpi_x%255);
$image[16] = chr(floor($dpi_y/255));
$image[17] = chr($dpi_y%255);

// Write the new JPG
file_put_contents($file, $msg);
于 2011-08-22T01:49:34.013 に答える