I'm using Umbraco 6.
I try to create 2 Thumbnails for each photo I upload with the Mediapicker. I mean - every photo that upload should have 140x100 version and 350 x 200 version.
I don't want to use the ImageGen.
So I found this article about the WebImage helper - with this code:
@{
WebImage photo = null;
var newFileName = "";
var imagePath = "";
var imageThumbPath = "";
if(IsPost){
photo = WebImage.GetImageFromRequest();
if(photo != null){
newFileName = Guid.NewGuid().ToString() + "_" +
Path.GetFileName(photo.FileName);
imagePath = @"images\" + newFileName;
photo.Save(@"~\" + imagePath);
imageThumbPath = @"images\thumbs\" + newFileName;
photo.Resize(width: 60, height: 60, preserveAspectRatio: true,
preventEnlarge: true);
photo.Save(@"~\" + imageThumbPath);
}
}
}
So actually I just created a new Razor Script (under the Developer section) - and it just doesn't work...
How do I do it? All I need to do is just to create a Thumbnail for each photo I upload with the media picker - then use them in my pages.
Thanks!