First of all, this is a fantastic package and something that is very useful! Great work guys!!
I have one query at this point, that i am hoping you can help me with. In the user control we have set the max size kb to 1 and the longest side to 800. We have hidden the textfields.
This means when a user uploads an image it will resize the image to 800px all the time. Is there a way to stop it doing this if no sides are smaller than the 800px. e.g if the user uploads an image 400 x 300px it won't do any resizing. Its more the dimensions than physical byte size that is causing some problems when we combine this with say the image cropper.
Just to say i found a workaround - i inserted a little bit of jQuery in the user control that will check if the longest side is larger than the specified one. I have pasted code below in case anyone else needs it.
Kenny
function updateData() {
var vsize = $('#TBSize').val(); var vdim = $('#TBDim').val(); var vcomp = $('#DDComp').val();
// added by KB: 07/02/2012
var kWidth = $('#file_upload').width(); var kHeight = $('#file_upload').height();
I have a half done version with an don't upscale checkbox. Going to have a play with it tonight and see if I can get it ready. Also fixes the w/h thumbnail ratio bug on taller images.
Hi again Kenny. DM me your email on twitter (eoutvik) and I'll send you the updated files for this. Have done some testing on a dev site and seems to be working as intended. Wont release as package before handeling of filetypes other than images is implemented.
Resizing Smaller Images
Hi,
First of all, this is a fantastic package and something that is very useful! Great work guys!!
I have one query at this point, that i am hoping you can help me with. In the user control we have set the max size kb to 1 and the longest side to 800. We have hidden the textfields.
This means when a user uploads an image it will resize the image to 800px all the time. Is there a way to stop it doing this if no sides are smaller than the 800px. e.g if the user uploads an image 400 x 300px it won't do any resizing. Its more the dimensions than physical byte size that is causing some problems when we combine this with say the image cropper.
Thanks in advance for any help!
Kenny
Hi,
Just to say i found a workaround - i inserted a little bit of jQuery in the user control that will check if the longest side is larger than the specified one. I have pasted code below in case anyone else needs it.
Kenny
function updateData() {
var vsize = $('#TBSize').val();
var vdim = $('#TBDim').val();
var vcomp = $('#DDComp').val();
// added by KB: 07/02/2012
var kWidth = $('#file_upload').width();
var kHeight = $('#file_upload').height();
if (kWidth > vsize || kHeight > vsize) {
//do nothing
}
else {
if(kWidth > kHeight){
vsize = kWidth;
}
else{
vsize = kHeight;
}
}
// end added code
$('#file_upload').uploadifySettings('scriptData', { 'wsize': vsize });
$('#file_upload').uploadifySettings('scriptData', { 'wdim': vdim });
$('#file_upload').uploadifySettings('scriptData', { 'wcomp': vcomp });
}
Hi Kenny,
Glad to see that someone else found a use for it :) Next version should probably have a "don't upscale" checkbox. Until then, js hacks ftw ;)
I just uploaded the latest version of the source code (0.5) if anyone is interested.
Ernst
Hi Ernst,
That code i posted above....yeah that doesn't work!! It all looked grand, but after some further tetsing, it definately doesnt work! Oops!
That "dont upscale" thing - would that be something thats easy to do?
Kenny
Hi
I have a half done version with an don't upscale checkbox. Going to have a play with it tonight and see if I can get it ready. Also fixes the w/h thumbnail ratio bug on taller images.
Teaser image ;)
Hi again Kenny. DM me your email on twitter (eoutvik) and I'll send you the updated files for this. Have done some testing on a dev site and seems to be working as intended. Wont release as package before handeling of filetypes other than images is implemented.
Ernst
Hi Ernst,
Sent you a DM on twitter. Thanks for this - i will give it a test and let you know how i get on!
Cheers! :)
K
is working on a reply...