When I upload a image in BackOffice, I can see that the image is created in D:\Code_RuntimeFiles\Media
But Umbraco can't display the image in BackOffice or in my views.
A bug?
When I added a custom ImageController to override the "get" part, I could display the image (BackOffice and in my views). But then ImageProccessor didn't started...
public class MediaController : Controller
{
private readonly MediaFileManager _mediaFileManager;
private readonly IImageUrlGenerator _imageUrlGenerator;
public MediaController(
MediaFileManager fileManager,
IImageUrlGenerator imageUrlGenerator)
{
_mediaFileManager = fileManager;
_imageUrlGenerator = imageUrlGenerator;
}
public IActionResult Index(string id, string file)
{
var imagePath = Path.Combine(id, file);
var ext = Path.GetExtension(imagePath);
// we need to check if it is an image by extension
if (_imageUrlGenerator.IsSupportedImageFormat(ext) == false)
return NotFound();
var image = _mediaFileManager.FileSystem.OpenFile(imagePath);
return File(image, MediaTypeNames.Image.Jpeg);
}
}
Hi Andreas. Did you manage to resolve this? I'm having the same issue. I was able to implement a custom FileSystemProvider, but using a directory outside of wwwroot breaks ImageSharp. I think we need to look at how the Umbraco.StorageProviders.AzureBlob package works and implement a similar FileSystemProvider:
Change storage location of the media folder
Hi, I have a problem reading from media folder (Or Umbraco has).
I have followed these instructions to move my media folder: https://our.umbraco.com/documentation/Extending/FileSystemProviders/
My composer:
My ISiteSettings is from my appsettings.json:
When I upload a image in BackOffice, I can see that the image is created in D:\Code_RuntimeFiles\Media
But Umbraco can't display the image in BackOffice or in my views.
A bug?
When I added a custom ImageController to override the "get" part, I could display the image (BackOffice and in my views). But then ImageProccessor didn't started...
Update: I removed my MediaController.
I added this to Startup.cs/Configure:
Now I can see the images. BUT I get original images, not cropped (when I am using crop).
Why? :(
Thumbnail image in BackOffice is not 500px as requested:
Hi Andreas. Did you manage to resolve this? I'm having the same issue. I was able to implement a custom FileSystemProvider, but using a directory outside of wwwroot breaks ImageSharp. I think we need to look at how the Umbraco.StorageProviders.AzureBlob package works and implement a similar FileSystemProvider:
https://our.umbraco.com/documentation/Extending/FileSystemProviders/Azure-Blob-Storage/
https://github.com/umbraco/Umbraco.StorageProviders
https://our.umbraco.com/forum/umbraco-9/106879-umbraco-9-and-media-folder-location
I posted https://github.com/umbraco/Umbraco-CMS/issues/11580 regarding this fyi
is working on a reply...