-2

在这个 wiki 上有一个解决方案可以保存具有不同分辨率的图像的多个副本。
但我不知道我必须如何以及在哪个文件中使用它。
请帮助我。

$.blueimp.fileupload.prototype.processActions.duplicateImage = function (data, options) {
    if (data.canvas) {
        data.files.push(data.files[data.index]);
    }
    return data;
};
$('#fileupload').fileupload({
    processQueue: [
        {
            action: 'loadImage',
            fileTypes: /^image\/(gif|jpeg|png)$/,
            maxFileSize: 20000000 // 20MB
        },
        {
            action: 'resizeImage',
            maxWidth: 1920,
            maxHeight: 1200
        },
        {action: 'saveImage'},
        {action: 'duplicateImage'},
        {
            action: 'resizeImage',
            maxWidth: 1280,
            maxHeight: 1024
        },
        {action: 'saveImage'},
        {action: 'duplicateImage'},
        {
            action: 'resizeImage',
            maxWidth: 1024,
            maxHeight: 768
        },
        {action: 'saveImage'}
    ]
});
4

1 回答 1

1

上传.class.php

    function __construct($options = null, $initialize = true) {

    $this->options = array(
        'script_url' => $this->get_full_url().'/',

       /*.
         .
         .
         .
         .
         .
         .
         .*/,

         /************************************************************************/
         /************************************************************************/
         // find: 'image_versions' and examine the tags (thumbnail,medium)
         /************************************************************************/
         /************************************************************************/

        'image_versions' => array(
            // Uncomment the following to create medium sized images:

            'medium' => array(
                'max_width' => 460,
                'max_height' => 460,
                'min_width' => 140,
                'min_height' => 140,
                'jpeg_quality' => 85
            ),

            'thumbnail' => array(
                'max_width' => 230,
                'max_height' => 230,
                'min_width' => 140,
                'min_height' => 140,
                'jpeg_quality' => 85
            )
        )
    );

图片版本文件路径:".../files/medium/a.jpg" , ".../files/thumbnail/a.jpg" , ".../files/a.jpg"

于 2013-08-02T21:47:13.183 回答