-
Notifications
You must be signed in to change notification settings - Fork 45
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Scaling WebP images fail in synchronously mode. #53
Comments
Looks like optimization pipeline is executed 2 times:
Second step gets webp instead of png (or jpeg) so it can't scale. Unfortunately I could not translate hypothesis into code and make a proper PR so far, so I've applied a workaround to not apply webp optimization on scaling requests - extend
|
Other folks have solved it like this: |
I can also reproduce this issue. The link above from HageMaster makes no difference as that code is in sitecore 9.0+ now from what I can see (even 8.2 is the same for this discussion). |
I can't confirm that @markgibbons25. |
Yes, I can reproduce it with or without the SaveColorProfileProcessor pipeline code from here I'm just saying that code seems to be in Sitecore.Kernel since at least 8.2.5, I would guess from the date that answer was posted they were on Sitecore 8.1 or an early version of 8.2 |
…ibwebp to 1.1.0. Change to use cwebp defaults. Add better support for webp files in media library.
…ibwebp to 1.1.0. Change to use cwebp defaults. Add better support for webp files in media library.
This is now resolved https://github.com/kamsar/Dianoga/releases/tag/5.0.0-beta.1 |
With the latest source and Dianoga.Strategy.GetMediaStreamSync.config
scaling WebP images fail In synchronously mode.
If the first request to a media with scaling parameters with a WebP Accept header you get the original uploaded image back, not scaled.
In the log file you see somethings like this:
8764 13:51:08 INFO Dianoga: optimized /Images/Doner.jpeg [original size] (final size: 12534 bytes) - saved 18461 bytes / 59.56 %. Optimized in 157ms.
8764 13:51:08 ERROR Could not run the 'getMediaStream' pipeline for '/sitecore/media library/Images/Doner'. Original media data will be used.
Exception: System.ArgumentException
Message: Parameter is not valid.
Source: System.Drawing
at System.Drawing.Bitmap..ctor(Stream stream)
at Sitecore.Resources.Media.SaveColorProfileProcessor.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)
Reproduction.
Result error in log, original uploaded media instead of scaled WebP Image.
When you first hit to the image (with the scaling parameters) is a non WebP request, then it can works okay.
The text was updated successfully, but these errors were encountered: