I’ve extended SqlServerDataProvider to use the azure blob storage account for storing the media library assests. I’ve taken reference from below GitHub project: https://github.com/aweber1/Sitecore.Media.AzureBlobStorage
Everything looks fine but I am getting below error:
Exception: System.ArgumentException Message: Parameter is not valid. Source: System.Drawing at System.Drawing.Bitmap..ctor(Stream stream) at Sitecore.Resources.Media.ImageEffectsResize.ResizeImageStream(Stream inputStream, TransformationOptions options, ImageFormat outputFormat) at Sitecore.Resources.Media.ImageThumbnailGenerator.GetStream(MediaData mediaData, TransformationOptions options) at Sitecore.Resources.Media.MediaData.GetThumbnailStream(TransformationOptions options) at Sitecore.Resources.Media.ThumbnailProcessor.Process(GetMediaStreamPipelineArgs args) at (Object , Object ) at Sitecore.Pipelines.CorePipeline.Run(PipelineArgs args) at Sitecore.Pipelines.DefaultCorePipelineManager.Run(String pipelineName, PipelineArgs args, String pipelineDomain, Boolean failIfNotExists)
at Sitecore.Pipelines.DefaultCorePipelineManager.Run(String pipelineName, PipelineArgs args, String pipelineDomain) at Sitecore.Resources.Media.Media.GetStreamFromPipeline(MediaOptions options, Boolean& canBeCached)
Because of above error the CE is very slow as Sitecore loads the actual image in the image field.
I’ve verified the GetMediaStreamPipelineArgs parameters while getting the stream from database (default one) and getting the stream from the azure blob storage account. I’ve found below differences in the MediaData.GetStream().Stream property:
Getting the media steam from the database:
CanRead: true
CanSeek: false
CanTimeout: false
CanWrite: false
Length: 1433038
Position: 0
Getting the media stream from the azure blob storage account:
CanRead: true
CanSeek: true
CanTimeout: false
CanWrite: true
Length: 1433038
Position: 0
It looks like the CanSeek=true is causing the issue while initializing the System.Drawing.Bitmap object.
Sitecore Version: Sitecore Experience Platform 9.0 Update-1
Can anyone please help me?