Hallo,
I will like to upload two versions of a jpeg file, both in a reduced size of the original image...
Its in classic ASP - I have taken the basic demo there comes with the installation and jused that to work from.
I will like these:
Uploading of the reduced files
1 small version (thumbnail) cropped for 150x150 px
1 lager version (preview) in 600x800 px (fit mode) - the user have option for cropping before upload
No upload of the orignal file
I have this code:
function beforeUploadHandler(){
var cropWidth = 150;
var cropHeight = 150;
var count = this.files().count();
for (var i=0; i < count; i++) {
var $file = this.files().get(i);
var imageCenterX = $file.width() / 2;
var imageCenterY = $file.height() / 2;
var cropBounds = [(imageCenterX - cropWidth/2),
(imageCenterY - cropHeight/2), cropWidth, cropHeight];
$file.cropBounds(cropBounds);
}
}
var uploader = $au.uploader({
id: 'Uploader1',
width: '100%',
height: '600px',
licenseKey: '76FF4-004B4-AAD7C-10EC1-0E4EF-BA8D52',
enableDescriptionEditor: true,
enableRotation: true,
enableAutoRotation: true,
enableImageEditor: true,
activeXControl: {
codeBase: 'Scripts/ImageUploader7.cab',
codeBase64: 'Scripts/ImageUploader7_x64.cab'
},
javaControl: {
codeBase: 'Scripts/ImageUploader7.jar'
},
uploadSettings: {
actionUrl: 'tilfoj/Upload.asp',
redirectUrl: 'default.asp',
filesPerPackage: 1
},
converters: [
{ mode: '*.*=SourceFile' },
{ mode: '*.*=Thumbnail', thumbnailFitMode: 'ActualSize', thumbnailApplyCrop: true }
],
events: { beforeUpload: beforeUploadHandler },
folderPane: {
viewMode: 'Thumbnails',
height: 370
},
uploadPane: {
viewMode: 'List',
},
restrictions: {
fileMask: '*.jpg;*.jpeg;'
}
});
var ip = $au.installationProgress(uploader);
ip.progressImageUrl('Images/installation_progress.gif');
ip.progressCssClass('ip-progress');
ip.instructionsCssClass('ip-instructions');
uploader.writeHtml();
Its works fine, but:
My thumbnail on 150x150 px is cropped just fine, but if the user make a crop in the editor before uploaded is not applyed to the large version of the file I upload - how to make that option happend?
Regards
Søren
Denmark