Rank: Member
Groups: Member
Joined: 8/13/2008(UTC) Posts: 14
|
Hi, I set up a method to resize images on demand before uploading: 1.) jpg, no resize: original file is uploaded 2.) jpg, resize demanded: thumbnail is uploaded 3.) other files: original file is uploaded the code: Code:var imageUploader = $au.uploader({
...
converters: [
{ mode: '*.jpg=Thumbnail;*.*=SourceFile', thumbnailWidth: 10000, thumbnailHeight: 10000 }
],
});
2 input fields with height and width override: 'client_x', 'client_y' Code:function beforePackageUploadHandler()
{
client_x = parseInt(document.getElementById('client_x').value)
client_y = parseInt(document.getElementById('client_y').value)
if ((!isNaN(client_x)) && (!isNaN(client_y)))
{
var c = imageUploader.converters().get(0);
c.thumbnailWidth(client_x);
c.thumbnailHeight(client_y);
}
else
{
var c = imageUploader.converters().get(0);
c.thumbnailWidth(10000);
c.thumbnailHeight(10000);
}
}
So, if no resize is demanded, the thumbnail is set 10000x10000 (and the image won`t be touched, because its smaller) This works great on localhost, but on my productive server I get the message that the thumbnails are too big for the license. (if no resize is demanded and the thumbnail is resized to 10000 x 10000, which would not happen) So, instead of setting the thumnail to a big size that would not be fired, I have to remove the Code:{ mode: '*.jpg=Thumbnail;*.*=SourceFile', thumbnailWidth: 10000, thumbnailHeight: 10000 }
and rewrite the function beforePackageUploadHandler that only thumbnails are generated if demanded. Any ideas? bst regards Bernd Edited by moderator Monday, March 21, 2011 9:34:08 AM(UTC)
| Reason: Not specified
|
|
|
|
Rank: Member
Groups: Member
Joined: 8/13/2008(UTC) Posts: 14
|
I guess I figured it out: Code:var imageUploader = $au.uploader({
...
converters: [
{ mode: '*.*=SourceFile'}]
})
function beforePackageUploadHandler()
{
client_x = parseInt(document.getElementById('client_x').value)
client_y = parseInt(document.getElementById('client_y').value)
if ((!isNaN(client_x)) && (!isNaN(client_y)))
{
var c = imageUploader.converters().get(0);
c.mode('*.jpg=Thumbnail;*.*=SourceFile')
c.thumbnailWidth(client_x);
c.thumbnailHeight(client_y);
}
else
{
var c = imageUploader.converters().get(0);
c.mode('*.*=SourceFile')
}
}
Will this work with the express license? best regards Bernd Edited by moderator Monday, March 21, 2011 12:18:22 PM(UTC)
| Reason: Not specified
|
|
|
|
Rank: Advanced Member
Groups: Member, Administration, Moderator Joined: 8/3/2003(UTC) Posts: 1,070
Thanks: 1 times Was thanked: 12 time(s) in 12 post(s)
|
Hello Bernd,
Image Uploader Express supports thumbnails of size 3Mpix and less. Returning to your code, say, client_x = 2000 and client_y = 2000, in this case it will be 4Mpix (2000 x 2000 = 4 000 000), this thumbnail does not work with Express edition. |
|
|
|
|
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.