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

Notification

Icon
Error

Options
Go to last post Go to first unread
AGH  
#1 Posted : Saturday, May 7, 2011 1:22:30 AM(UTC)
AGH

Rank: Newbie

Groups: Member
Joined: 5/7/2011(UTC)
Posts: 3

Hi,
I download image uploder express and i want to create a thumbnail copy only i cropped image. For example i select 10 image and only one of them i cropped i want to see 11 files in my server and cropped image name filename+cropped or something. the others orginal filename. how can i do this ?
AGH  
#2 Posted : Saturday, May 7, 2011 4:01:06 AM(UTC)
AGH

Rank: Newbie

Groups: Member
Joined: 5/7/2011(UTC)
Posts: 3

<cc1:Uploader ID="Uploader1" runat="server" Height="500" Width="600" DestinationFolder="~/Resimler/HaberResimler"
CancelUploadButtonText="Durdur" Language="Turkish" LoadingFolderContentText="İçerik yükleniyor..."
UploadButtonText="Karşıya Yükle" AutoSave="true">
<Converters>
<cc1:Converter Mode="*.*=SourceFile" />
<cc1:Converter Mode="*.*=Thumbnail" ThumbnailFitMode="ActualSize" ThumbnailApplyCrop="true"/>
</Converters>

</cc1:Uploader>

on this way component create a copy filenam+Thumbnail1 all files i want only create a copy cropped image.
Dmitry.Obukhov  
#3 Posted : Tuesday, May 10, 2011 2:26:30 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 Agah,

Sorry for the delayed answer.

I prepared an example of server-side script using ASP.NET control. It allows to save images with “_cropped” suffix if they were cropped, and save with original name, if images were sent without changes:
Code:

UploadedFile uploadedFile = e.UploadedFile;
//Get converter
ConvertedFile File = uploadedFile.ConvertedFiles[0];
if (File != null)
{
  string sourceName = Utils.GetSafeFileName(gallery.UploadedFilesAbsolutePath,   uploadedFile.SourceName);
  //Check whether it was cropped
  if (uploadedFile.CropBounds.Width != uploadedFile.SourceWidth || uploadedFile.CropBounds.Height != uploadedFile.SourceHeight)
  {
    string baseName = Path.GetFileNameWithoutExtension(uploadedFile.SourceName);
    string ext = Path.GetExtension(uploadedFile.SourceName);
    string croppedName = baseName + "_cropped" + ext;

    //Save file with “_cropped” suffix in its name
    File.SaveAs(Path.Combine(gallery.UploadedFilesAbsolutePath, croppedName));
  }
else
    // Save file with original name
    File.SaveAs(Path.Combine(gallery.UploadedFilesAbsolutePath, sourceName)); 
}

If you have any additional questions or problems, please feel free to let me know.
Best regards,
Dmitry Obukhov
Technical Support. Aurigma, Inc.
AGH  
#4 Posted : Tuesday, May 10, 2011 2:48:28 AM(UTC)
AGH

Rank: Newbie

Groups: Member
Joined: 5/7/2011(UTC)
Posts: 3

thank u very much it very usefull...
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.