クライアント側のサムネイル画像の作成とアップロードに関するこのスレッドを見つけました。トレッドは、最初の画像をアップロードしてから、サイズを変更して再度アップロードする方法を示しています。別のステップを追加する簡単な方法があるかどうか疑問に思っていたので、最終結果は元の、中サイズのサムネイルを生成します
A better solution is to trigger QueueChanged in the FileUploaded handler, and then call refresh. This will initiate the upload again for the same file and you can set a property that you read in the BeforeUpload handler to adjust the file size.
警告 #1: フルサイズの画像の後にサムネイルをアップロードする必要があります。そうしないと、フルサイズの画像にバッファの問題が発生し、途切れる可能性があります。
警告 #2: これは、FileUploaded の bind 呼び出しが uploader.init() の後に発生する場合にのみ機能します。そうしないと、FileUploaded のアップローダ独自のハンドラが、ハンドラの後に file.status を上書きして DONE に戻します。
以下は、このスレッドからの元の応答ですPlupload Thumbnail
uploader.bind('BeforeUpload', function(up, file) {
if('thumb' in file)
up.settings.resize = {width : 150, height : 150, quality : 100};
else
up.settings.resize = {width : 1600, height : 1600, quality : 100};
}
uploader.bind('FileUploaded', function(up, file) {
if(!('thumb' in file)) {
file.thumb = true;
file.loaded = 0;
file.percent = 0;
file.status = plupload.QUEUED;
up.trigger("QueueChanged");
up.refresh();
}
}