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

Notification

Icon
Error

Options
Go to last post Go to first unread
st-denmark  
#1 Posted : Wednesday, January 25, 2012 3:36:29 PM(UTC)
st-denmark

Rank: Newbie

Groups: Member
Joined: 1/25/2012(UTC)
Posts: 2

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
Dmitry.Obukhov  
#2 Posted : Thursday, January 26, 2012 12:28:05 AM(UTC)
Dmitry.Obukhov

Rank: Advanced Member

Groups: Administration
Joined: 5/29/2010(UTC)
Posts: 1,310

Thanks: 8 times
Was thanked: 111 time(s) in 111 post(s)
Hello Soeren,

Thanks for contacting us.
Quote:
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?

You upload source file and thumbnail (with thumbnailFitMode = ActualSize). Source file of image is uploaded without changes. Crop action effects on thumbnail only. On server you get source file (original) and cropped thumbnail
As far as I understand you need to get:
  1. automatically cropped thumbnail (150x150);
  2. thumbnail which can be cropped by user manually in Image Editor.
Unfortunately, it is not possible to get two thumbnails which can be cropped in different ways. Cropping will be applied for all converters you set (except SourceFile).

You can try this way. You will set the same converters you have now (source file and thumbnail with fit mode = ActualSize). Thumbnail will be cropped and uploaded and source file will be uploaded just originally. Then you can use any third-party software which will allow your users to crop source files.
Best regards,
Dmitry Obukhov
Technical Support. Aurigma, Inc.
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.