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

Notification

Icon
Error

Options
Go to last post Go to first unread
quacka  
#1 Posted : Monday, August 21, 2006 5:32:41 PM(UTC)
quacka

Rank: Member

Groups: Member
Joined: 1/17/2005(UTC)
Posts: 32

Hi,

I want to have a checkbox on my page which when the user ticks, image doesn't get optimised. If they don't get tick the image gets optimised like below.

Code:
//Checkbox not ticked Resizing Image
iu.addParam("UploadSourceFile", "false");
iu.addParam("AllowRotate", "false");

iu.addParam("UploadThumbnail2FitMode", "Width");
iu.addParam("UploadThumbnail2Width", "1000");
iu.addParam("UploadThumbnail2JpegQuality", "100");

//Checkbox ticked, Do Not Resize Image, no thumbnail uplaoded
iu.addParam("UploadSourceFile", "True");

Is this possible?

Edited by user Tuesday, February 19, 2008 1:11:23 PM(UTC)  | Reason: Not specified

Fedor  
#2 Posted : Wednesday, August 23, 2006 7:45:53 PM(UTC)
Fedor

Rank: Advanced Member

Groups: Member, Administration, Moderator
Joined: 7/28/2003(UTC)
Posts: 1,660

Thanks: 5 times
Was thanked: 76 time(s) in 74 post(s)
Hello,

Quote:
quacka (8/22/2006)

Hi,

I want to have a checkbox on my page which when the user ticks, image doesn't get optimised. If they don't get tick the image gets optimised like below.

Code:
//Checkbox not ticked Resizing Image
iu.addParam("UploadSourceFile", "false");
iu.addParam("AllowRotate", "false");

iu.addParam("UploadThumbnail2FitMode", "Width");
iu.addParam("UploadThumbnail2Width", "1000");
iu.addParam("UploadThumbnail2JpegQuality", "100");

//Checkbox ticked, Do Not Resize Image, no thumbnail uplaoded
iu.addParam("UploadSourceFile", "True");

Is this possible?

You should use iu.addParam syntax during initialization only. In runtime you should use getImageUploader("ImageUploaderID").setPropertyName(value) syntax.

So way the code you should use is following:

Code:

<label for="chkOptimize"><input id="chkOptimize" type="checkbox" onclick="chkOptimize_click();"> Optimize</label>

function chkOptimize_click("chkOptimize"){

  var imageUploader1 = getImageUploader("ImageUploader1");

  if (!document.getElementById("chkOptimize").checked)

    //Checkbox not ticked Resizing Image
    imageUploader1.setUploadSourceFile(false);
    imageUploader1.setAllowRotate(false);

    imageUploader1.setUploadThumbnail2FitMode("Width");
    imageUploader1.setUploadThumbnail2Width("1000");
    imageUploader1.setUploadThumbnail2JpegQuality("100");

  }
  else {

    //Checkbox ticked, Do Not Resize Image, no thumbnail uplaoded
    imageUploader1.setUploadSourceFile(true);
    imageUploader1.setUploadThumbnail2FitMode("Off");

  }
}

Please note, this code is untested.

Edited by user Tuesday, February 19, 2008 1:11:50 PM(UTC)  | Reason: Not specified

Best regards,

Fedor Skvortsov

zoomphoto  
#3 Posted : Monday, August 25, 2008 4:03:15 AM(UTC)
zoomphoto

Rank: Member

Groups: Member
Joined: 4/4/2008(UTC)
Posts: 11

Do you have a version of this code that would work with the new v5.5?

I am very interested in this too... I would like the client to decide on whether they want to send up the original or not.

Thanks

Fedor  
#4 Posted : Monday, August 25, 2008 5:16:10 PM(UTC)
Fedor

Rank: Advanced Member

Groups: Member, Administration, Moderator
Joined: 7/28/2003(UTC)
Posts: 1,660

Thanks: 5 times
Was thanked: 76 time(s) in 74 post(s)
It should work with version 5.5.
Best regards,

Fedor Skvortsov

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.