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

Notification

Icon
Error

Options
Go to last post Go to first unread
alfafado  
#1 Posted : Tuesday, July 20, 2010 11:11:46 PM(UTC)
alfafado

Rank: Member

Groups: Member
Joined: 6/29/2010(UTC)
Posts: 13

//Configure thumbnail settings.

$iu->setUploadThumbnail1FitMode('Fit');

$iu->setUploadThumbnail1Width(149);

$iu->setUploadThumbnail1Height(105);

$iu->setUploadThumbnail2FitMode('Fit');

$iu->setUploadThumbnail2Width(601);

$iu->setUploadThumbnail2Height(395);

Source file is 640 x 480

The uploaded file is 526 x 395.

I understand that this is due to the original propotions being retained.

But it is the width that is important, I would like an image to be uploaded in the size I state, cropping if required, is this possible? If this is not possible, I would like the thumbnail to be the correct width, the height is not so important.

Many thanks.

Edited by user Tuesday, July 20, 2010 11:29:18 PM(UTC)  | Reason: Not specified

Dmitry.Obukhov  
#2 Posted : Wednesday, July 21, 2010 5:44:44 PM(UTC)
Dmitry.Obukhov

Rank: Advanced Member

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

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

I’ve reproduced your behaviour. I uploaded the 640x480 image and actually got the thumbnail with the size 526x395.

To get the thumbnail with the needed width, you should set the value of the UploadThumbnailXFitMode property to Width:

Code:
 $iu->setUploadThumbnail1FitMode('Width');

It works as you need.

If you have any questions or problems please feel free to let me know.

Best regards,

Dmitry Obukhov

Technical Support. Aurigma, Inc.

alfafado  
#3 Posted : Wednesday, July 21, 2010 6:06:23 PM(UTC)
alfafado

Rank: Member

Groups: Member
Joined: 6/29/2010(UTC)
Posts: 13

I've tried setting the setUploadThumbnail1FitMode to 'Width', it has no effect!
Dmitry.Obukhov  
#4 Posted : Wednesday, July 21, 2010 6:48:07 PM(UTC)
Dmitry.Obukhov

Rank: Advanced Member

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

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

You should set the value of the UploadThumbnailXFitMode property to Width for that thumbnail which you need. If you need to get the thumbnail1 with the width 601 you should use it:

Code:

$iu->setUploadThumbnail1FitMode('Width');
$iu->setUploadThumbnail1Width(601);
$iu->setUploadThumbnail1Height(395);

If you want the thumbnai2 with the width 601 you should do it:

Code:

$iu->setUploadThumbnail2FitMode('Width');
$iu->setUploadThumbnail2Width(601);
$iu->setUploadThumbnail2Height(395);

Best regards,

Dmitry Obukhov

Technical Support. Aurigma, Inc.

alfafado  
#5 Posted : Wednesday, July 21, 2010 6:57:27 PM(UTC)
alfafado

Rank: Member

Groups: Member
Joined: 6/29/2010(UTC)
Posts: 13

Hi,

'setUploadThumbnail1FitMode ' was just an example! I have the following code:

Code:
$iu->setUploadThumbnail1Width(149);
$iu->setUploadThumbnail1Height(105);
$iu->setUploadThumbnail2Width(601);
$iu->setUploadThumbnail2Height(395);

$iu->setUploadThumbnail1FitMode('Width');
$iu->setUploadThumbnail2FitMode('Width');

setting fit mode has no effect on either thumbnail, I've tried placing the set fit mode command before the sizes too.

This time I'm using an original image : 840 x 1089

Thumbnail 1 gets resized to : 81×105

Edited by user Wednesday, July 21, 2010 9:02:08 PM(UTC)  | Reason: Not specified

Dmitry.Obukhov  
#6 Posted : Thursday, July 22, 2010 5:27:44 PM(UTC)
Dmitry.Obukhov

Rank: Advanced Member

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

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

I created simple application which allows saving two thumbnails. I tested it with the several images. The application worked okay. I tested it with the image (840x1089) and got two thumbnails which had widths 149 and 601 pixels respectively.

I attached the .zip file with the sample for your reference. Also you can find the image used for the test and generated thumbnails. Please try this application and let me know about the results.

Looking forward to reply from you.

File Attachment(s):
ThumbnailSample.zip (4,461kb) downloaded 1 time(s).
Best regards,

Dmitry Obukhov

Technical Support. Aurigma, Inc.

alfafado  
#7 Posted : Thursday, July 22, 2010 9:27:18 PM(UTC)
alfafado

Rank: Member

Groups: Member
Joined: 6/29/2010(UTC)
Posts: 13

Thank you!

Your Basic sample worked and I thought that I had fixed mine, but I can't seem to replicate that now. I have this code, I am uploading to Amazon S3, using Firefox:

Code:

//Configure thumbnail settings.
$iu->setUploadThumbnail1Width(149);
$iu->setUploadThumbnail1Height(105);
$iu->setUploadThumbnail2Width(601);
$iu->setUploadThumbnail2Height(395);
$iu->setUploadThumbnail1FitMode('Width');
$iu->setUploadThumbnail2FitMode('Width');

//Configure thumbnails/watermarks.
$iu->setUploadThumbnail1Watermark("opacity=70;ImageUrl=".PATH."images/Watermark.png;ImageWidth=149;ImageHeight=30;Position=BottomRight;");
$iu->setUploadThumbnail2Watermark("opacity=70;ImageUrl=".PATH."images/Watermark.png;ImageWidth=149;ImageHeight=30;Position=BottomRight;");

//Compute and send for files SHA and MD5 hash.
//$iu->setHashAlgorithm('SHA;MD5');

//Configure upload settings.
$iu->setAutoRecoverMaxTriesCount(10);
$iu->setAutoRecoverTimeOut(10000);

//Configure miscellaneous settings.
$iu->setShowDebugWindow(true);
$iu->setBackgroundColor('#ffffff');
$iu->setShowContextMenu(false);
$iu->setSilentMode(true);

//Add event handlers.
$iu->addClientBeforeUpload('ImageUploader1_BeforeUpload');
$iu->addClientProgress('ImageUploader1_Progress');

//Configure installation progress.
$iu->getInstallationProgress()->setVisible(true);
$iu->getInstallationProgress()->setProgressCssClass("ScreenStyle");
$iu->getInstallationProgress()->setInstructionsCssClass("ScreenStyle");

//create amazon s3 extender
$as3 = new AmazonS3Extender($iu);
$as3->setAWSAcceccKeyId(S3_ACCESS_KEY);
$as3->setSecretAccessKey(S3_SECRET_KEY);
$as3->setBucket($oPage->sParentBucket);
//Uploaded file properties
$file = $as3->getSourceFile();
//set ACL
$file->setAcl('public-read');
//set Key
$file->setKey($oPage->sKey.'original/${filename}');

//Uploaded file properties
$file = $as3->getThumbnail1();
//set ACL
$file->setAcl('public-read');
//set Key
$file->setKey($oPage->sKey.'thumb1/${filename}');

//Uploaded file properties
$file = $as3->getThumbnail2();
//set ACL
$file->setAcl('public-read');
//set Key
$file->setKey($oPage->sKey.'thumb2/${filename}');


//render image uploader markup
$iu->render();

many thanks.

Edited by user Thursday, July 22, 2010 10:10:57 PM(UTC)  | Reason: Not specified

alfafado  
#8 Posted : Sunday, July 25, 2010 5:13:21 PM(UTC)
alfafado

Rank: Member

Groups: Member
Joined: 6/29/2010(UTC)
Posts: 13

For some reason this question has been marked as answered, but it hasn't been.
andreym  
#9 Posted : Sunday, July 25, 2010 10:17:27 PM(UTC)
andreym

Rank: Advanced Member

Groups:
Joined: 6/16/2009(UTC)
Posts: 134

Was thanked: 8 time(s) in 8 post(s)
Hello!

I've made some changes in the original Amazon S3 Images sample. So now it resize thumbnails by width. Your code is fine, but also you need to set fit mode in the sendhelper.js file. And disable autorecovery option (setAutoRecoverMaxTriesCount(0)), since it is not working with Amazon S3 Extender. Please, try the attached demo and reply how it works for you.

File Attachment(s):
AmazonS3Upload.zip (2,314kb) downloaded 1 time(s).
alfafado  
#10 Posted : Tuesday, July 27, 2010 4:18:46 PM(UTC)
alfafado

Rank: Member

Groups: Member
Joined: 6/29/2010(UTC)
Posts: 13

Success! Many thanks.
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.