Plupload以不同的尺寸保存每个图像

时间:2014-10-25 15:38:26

标签: javascript php image-uploading plupload

我正在使用Plupload将图像上传到服务器。但我想以原始方式保存每个图像,但也作为缩略图。

这是我的代码:

$(function() {
$("#uploader").plupload({
    // Allgemeine Einstellungen
    runtimes : 'html5,flash,silverlight,html4',
    url : 'Uploader/examples/upload.php', // Datei führt Upload aus

    // max. Anzahl von Dateien
    max_file_count: 10,

    chunk_size: '1mb',

    // Materialien skalieren, um Ladekapazität der App nicht zu überschreiten
    // Zitat des Docs: "obviously resize is not the best name for the option, since currently we can only downsize"
    // http://www.plupload.com/docs/Image-Resizing-on-Client-Side
    resize : {
        width : 2000, 
        height : 2000, 
        quality : 100,
        preserve_headers: false, // Header von jpg Dateien löschen
        crop: false // crop deaktivieren, damit das Bild gesamt bleibt
    },

    filters : {
        // max. Dateigröße
        max_file_size : '100mb',
        // Dateitypen (Bilder und Videos)
        mime_types: [
            {title : "Image files", extensions : "jpg,jpeg,gif,png"}, //Bidler
            {title : "Video files", extensions : "mov,mp4,m4v"} // Videos (werden von iOS unterstützt)
        ]
    },

    // Nutzer kann die Bilder nicht manuell umbenennen
    rename: false,

    // Nutzer kann Dateien sortieren
    sortable: true,

    // Die abgespeicherten Daten haben einmalige Namen
    unique_names:true,

    // Der Nutzer kann nicht manuell den Upload starten - Button deaktiviert
    buttons:{start:false},

    // DragDrop Feature (currently only HTML5 supports that)
    dragdrop: true,

    // Views to activate
    views: {
        list: true,
        thumbs: true, // Show thumbs
        active: 'thumbs'
    },

    // Alternative , falls Browser nicht unterstützt wird
    // Flash settings
    flash_swf_url : 'Uploader/js/Moxie.swf',
    // Silverlight settings
    silverlight_xap_url : 'Uploader/js/Moxie.xap',

有没有简单的方法来实现这一目标?不幸的是Plupload没有提供这样的功能

由于 克里斯

0 个答案:

没有答案
相关问题