Rank: Member
Groups: Member
Joined: 1/6/2010(UTC) Posts: 15
|
Aurigma IU does not offer the ability to add a megapixels parameter to filter those photos from being allowed in the upload. I know the feature is on the wishlist, but until it's implemented I thought I would be able to handle it myself; however, it doesn't appear to be working. I'm using the ImageUploader.UploadFileRemove Method to try to remove the file from being uploaded, but it still uploads. This is the code: Code:
iu.addEventListener("BeforeUpload", function()
{
var iuobj = getImageUploader("ImageUploader1");
var total_files = iuobj.getUploadFileCount();
for (var i = 1; i < total_files+1; i++)
{
var o_width = iuobj.getUploadFileWidth(i);
var o_height = iuobj.getUploadFileHeight(i);
var o_megapixels = (o_width * o_height) / 1000000;
if (o_megapixels > 16)
{
alert('file removed!');
iuobj.UploadFileRemove(i);
}
}
});
It grabs the dimensions of the original file and calculates the megapixels. If the photo is greater than 16 megapixels it should be removed. This does not work. Is this not possible? I'm using IU Version: 6.5.1.0.
|
|
|
|
Rank: Advanced Member
Groups: Administration
Joined: 3/9/2008(UTC) Posts: 554
Was thanked: 1 time(s) in 1 post(s)
|
|
|
|
|
|
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.