Welcome Guest! You need to login or register to make posts.

Notification

Icon
Error

Options
Go to last post Go to first unread
Sergey Vin  
#1 Posted : Tuesday, January 25, 2011 2:12:57 AM(UTC)
Sergey Vin

Rank: Newbie

Groups: Member
Joined: 1/25/2011(UTC)
Posts: 4

Hello,

We use Aurigma Image Uploader v 6.5.6.0 in our project.
To control when image is checked we try to use example from documentation:

Code:
function ImageUploader_UploadFileCountChange(){
    var imageUploader=getImageUploader("ImageUploader1");
    for (i=imageUploader.getUploadFileCount(); i>=1; i--){
        if (imageUploader.getUploadFileHeight(i)/imageUploader.getUploadFileWidth(i)!=0.75){
            alert(imageUploader.getUploadFileName(i) + " doesn't have 3:4 ratio.");
            imageUploader.UploadFileRemove(i);
        }
    }
}


In FF all OK but when this code runs in IE8 this event calls alert twice :(
if imageUploader.UploadFileRemove(i); line is removed from code all OK in IE8 too.

Please Help.

Edited by moderator Tuesday, January 25, 2011 2:22:05 AM(UTC)  | Reason: Not specified

Dmitry.Obukhov  
#2 Posted : Wednesday, January 26, 2011 3:47:29 AM(UTC)
Dmitry.Obukhov

Rank: Advanced Member

Groups:
Joined: 5/29/2010(UTC)
Posts: 1,310

Thanks: 8 times
Was thanked: 111 time(s) in 111 post(s)
Hello Sergey,

I am sorry for the long delay.

Unfortunately, it is a bug of Image Uploader 6 ActiveX edition. There are workarounds, which allow avoiding the double calling UpoadFileCountChange event in IE.
  1. Here is the workaround if you use one pane or three panes layout:
    Code:
    
    var _removeInProcess = false;
    
    function removeLargeImages() {
        var imageUploader=getImageUploader("ImageUploader1");
        for (i=imageUploader.getUploadFileCount(); i>=1; i--){
            if (imageUploader.getUploadFileHeight(i)/imageUploader.getUploadFileWidth(i)!=0.75){
                alert(imageUploader.getUploadFileName(i) + " doesn't have 3:4 ratio.");
                imageUploader.UploadFileRemove(i);
            }
        }    
        _removeInProcess = false;
    }
    
    function ImageUploader_UploadFileCountChange() {
        if (_removeInProcess) {
            return;
        }
        
        _removeInProcess = true;
    
        removeLargeImages();
    }
  2. The workaround if two panes layout is used:
    Code:
    
    var _removeInProcess = false;
    
    function removeLargeImages() {
            var imageUploader=getImageUploader("ImageUploader1");
        for (i=imageUploader.getUploadFileCount(); i>=1; i--){
            if (imageUploader.getUploadFileHeight(i)/imageUploader.getUploadFileWidth(i)!=0.75){
                alert(imageUploader.getUploadFileName(i) + " doesn't have 3:4 ratio.");
                imageUploader.UploadFileRemove(i);
            }
        }    
    
        _removeInProcess = false;
    }
    
    function ImageUploader_UploadFileCountChange() { 
        if (_removeInProcess) {
            return;
        }
        _removeInProcess = true;
    
        setTimeout('removeLargeImages()', 0);
    }
I tested these workarounds locally, and they worked okay for me. Please try one of workarounds listed above, and let me know about your result. Sorry for the inconvenience and the delay once again.

FYI: We released Image Uploader 7, which is free of this issue, and many other ones. I would like to recommend you to use this version of Image Uploader.
Best regards,
Dmitry Obukhov
Technical Support. Aurigma, Inc.
Sergey Vin  
#3 Posted : Thursday, January 27, 2011 5:20:07 AM(UTC)
Sergey Vin

Rank: Newbie

Groups: Member
Joined: 1/25/2011(UTC)
Posts: 4

I integrated your code into our project and all work okay.
Thank You.
Users browsing this topic
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.