Search code examples
jquery-pluginsfile-uploadimage-resizing

jQuery file upload not resizing images anymore


I use jQuery file upload in my project since three months to upload and resize image files. Everything was working fine until last week. The plugin doesn't resize the images anymore (latest google chrome and latest firefox).

I'm using the same basic configuration on this page https://github.com/blueimp/jQuery-File-Upload/wiki/Basic-plugin

Does someone has the same issue and maybe a solution ?

Thanks


Solution

  • The best way is what I'm doing at present is:

    $('#fileupload').fileupload({
          dataType: 'json',
          url: 'Upload.ashx,
          done: function (e, data) {
          $("#page_navigation").show();
                $.each(data.result, function (index, file) {
                $('#placeholderforimages').append("<img style='height:48px;width:65px;' src='yourimagepath'>");
                }
     });
    

    UPDATE:

    Here is the wiki options you need to make an array and need to declare in that

    [
        {
            action: 'load',
            fileTypes: /^image\/(gif|jpeg|png)$/,
            maxFileSize: 20000000 // 20MB
        },
        {
            action: 'resize',
            maxWidth: 1920,
            maxHeight: 1200,
            minWidth: 800,
            minHeight: 600
        },
        {
            action: 'save'
        }
    ],