creating media with MediaService -> how to generate thumbnails?
Hi
When I upload media of type "Image" through the backoffice, it creates file.jpg, file_big-thumb.jpg, and file-thumb.jpg
However, when I create media files programatically, I'm not getting it to generate thumbnails during this process.
From a previous post I tried the suggestion of saving an empty media object, and then subsequently calling SetValue, but that doesn't work either.
private int CreateMedia(Stream file, string fileName)
{
var parentId = 2685; // image folder
var service = Services.MediaService;
var media = service.CreateMedia(fileName, parentId, "Image");
service.Save(media);
media.SetValue("umbracoFile", fileName, file);
service.Save(media);
file.Close();
return media.Id;
}
I know I can use a URL postfix (?width=500&mode=max&animationprocessmode=first) to invoke the ImageProcessor, but wondering why it's not working with MediaService.
creating media with MediaService -> how to generate thumbnails?
Hi
When I upload media of type "Image" through the backoffice, it creates
file.jpg
,file_big-thumb.jpg
, andfile-thumb.jpg
However, when I create media files programatically, I'm not getting it to generate thumbnails during this process.
From a previous post I tried the suggestion of saving an empty media object, and then subsequently calling
SetValue
, but that doesn't work either.I know I can use a URL postfix (?width=500&mode=max&animationprocessmode=first) to invoke the ImageProcessor, but wondering why it's not working with MediaService.
Any insights would be appreciated. Thanks!
is working on a reply...