1
ユーザーがhigh quality image
をアップロードしたソーシャルアンドロイドアプリを開発し、ダウンロードしてアプリフィードのリストビューに表示します。PHPで高解像度ではなく低解像度の画像をダウンロード
アップロード画像./uploads/ directory in my server.
に私は、サーバーに画像を保存するためにPHPに以下のコードを使用して保存します。
<?php
// Path to move uploaded files
error_reporting(E_ALL^E_DEPRECATED);
include 'conf.php';
$target_path = "uploads/";
// array for final json respone
$response = array();
// getting server ip address
$server_ip = gethostbyname(gethostname());
// final file url that is being uploaded
$file_upload_url = 'http://' . $server_ip . '/' . 'AndroidFileUpload' . '/' . $target_path;
if (isset($_FILES['image']['name'])) {
$target_path = $target_path . basename($_FILES['image']['name']);
try {
// Throws exception incase file is not being moved
if (!move_uploaded_file($_FILES['image']['tmp_name'], $target_path)) {
// make error flag true
print "error1";
}
print basename($_FILES['image']['name']);
} catch (Exception $e) {
// Exception occurred. Make error flag true
print "error2";
}
} else {
// File parameter is missing
print "error3";
}
?>
は今、私は別のディレクトリ内のすべてのimage
のlow resolution
を保存したい(またはリアルタイムで低解像度を得ます)それのurl
を取得し、php
をアンドロイドアプリに送って、私のアプリのユーザーは、image
の前にthumbnail
または画像のresolution
を見ることができます。
どうすればいいですか?
[アップロードされた画像からサムネイルを作成する]の可能複製(http://stackoverflow.com/questions/11376315/creating-a-thumbnail-from-an:あなたはこれを行うには、以下のコードを使用することができますアップロードされた画像) – Manikiran
あなたはtimthumb.phpをダウンロードしてサーバーにアップロードすることができ、timthumb.php?scr = image.jpg&h = height&w = width&zc = cropstyle(1,2,3)https:/ /github.com/GabrielGil/TimThumb/blob/master/timthumb.php –
イメージのリサンプリングを意味しますか? 、これをチェックしてください[http://stackoverflow.com/questions/4754594/how-do-you-resize-a-high-resolution-picture-with-php] – ganero