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

Notification

Icon
Error

Options
Go to last post Go to first unread
yeongland  
#1 Posted : Monday, January 31, 2011 11:45:07 PM(UTC)
yeongland

Rank: Newbie

Groups: Member
Joined: 1/19/2011(UTC)
Posts: 1

I do not want to save the source file as its too big to store.

I just wanted to save image file with thumbnail quality with 300 x 300. And another thumbnail with 50 x 50.

Currently i'm just able to save 1 300 x 300.

Below is my code front:

Code:
<Converters>
<aur:Converter Mode="*.*=Thumbnail" ThumbnailWidth="300" ThumbnailHeight="300" ThumbnailApplyCrop="true" ThumbnailWatermark="ImageUrl=Img/logoEn.png;Width=200;Height=80;Position=BottomRight;" />
 </Converters>

How to add another Thumbnail Mode to make it save to another folder and 50 x 50 width x height?

P/S: I'm using ASP.NET/VB

Edited by moderator Tuesday, February 1, 2011 12:18:04 AM(UTC)  | Reason: Not specified

Dmitry.Obukhov  
#2 Posted : Tuesday, February 1, 2011 1:53:51 AM(UTC)
Dmitry.Obukhov

Rank: Advanced Member

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

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

Thank you for contacting us.

Here is the code snippet which allows to add two converters:

Code:
…
 <Converters>
    <aur:Converter Mode="*.*=Thumbnail" ThumbnailWidth="300" ThumbnailHeight="300" ThumbnailApplyCrop="true" />
    <aur:Converter Mode="*.*=Thumbnail" ThumbnailWidth="50" ThumbnailHeight="50" ThumbnailApplyCrop="true" />
</Converters>
…

The server-side script which fires to save converters to the different folders on the server :

Code:

Dim galleryPath As String = Server.MapPath("Gallery/")
Dim thumbnailPath As String = Server.MapPath("Gallery/Thumbnails")
Protected Sub Uploader1_FileUploaded(ByVal sender As Object, ByVal e As Aurigma.ImageUploader.FileUploadedEventArgs)
    'The first converter (300x300)
     Dim sourceFile As ConvertedFile = e.UploadedFile.ConvertedFiles(0)
     Dim sourceFileName As String = sourceFile.Name
     'Save the first converter
     sourceFile.SaveAs(System.IO.Path.Combine(galleryPath, "thumbnail1_" + sourceFileName))
     'The second converter (50x50)
     Dim sourceFileTh As ConvertedFile = e.UploadedFile.ConvertedFiles(1)
     'Save the second converter
     sourceFileTh.SaveAs(System.IO.Path.Combine(thumbnailPath, "thumbnail2_" + sourceFileName))
End Sub

I created simple application based on Image Uploader ASP.NET control (VB code), and attached it for your reference. Please download and try it out. If you have any additional questions, please post them here.

Edited by user Tuesday, February 1, 2011 1:55:24 AM(UTC)  | Reason: Not specified

File Attachment(s):
ASPNETvbSample.zip (3,574kb) downloaded 2 time(s).
Best regards,

Dmitry Obukhov

Technical Support. Aurigma, Inc.

Users browsing this topic
Guest
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.