Skip to content
November 21, 2015 / kiranpatils

Could not run the ‘getMediaStream’ pipeline

Challenge:

After deploying our solution we were checking log files and we found following errors:

2096 02:02:02 ERROR Could not run the ‘getMediaStream’ pipeline for ‘/ImagePath’. Original media data will be used.
Exception: System.OverflowException
Message: Arithmetic operation resulted in an overflow.
Source: Sitecore.Kernel
at Sitecore.ImageLib.ThumbMaker.GetSourceByteAt(Int32 x, Int32 y)
at Sitecore.ImageLib.ThumbMaker.IndexedRezise(Int32 xSize, Int32 ySize, Boolean preserveResolution)
at Sitecore.ImageLib.Resizer.ResizeGif(Bitmap image, Size imageSize, Size frameSize, Color frameColor, Boolean preserveResolution)
at Sitecore.ImageLib.Resizer.Resize(Bitmap bitmap, Size imageSize, Size frameSize, Color frameColor, Boolean preserveResolution, ImageFormat format, InterpolationMode interpolationMode, CompositingMode compositingMode, PixelOffsetMode pixelOffsetMode)
at Sitecore.ImageLib.Resizer.Resize(Bitmap bitmap, ResizeOptions options, ImageFormat format, InterpolationMode interpolationMode)
at Sitecore.Resources.Media.ImageEffectsResize.ResizeImageStream(Stream inputStream, TransformationOptions options, ImageFormat outputFormat)
at Sitecore.Resources.Media.ResizeProcessor.Process(GetMediaStreamPipelineArgs args)
at (Object , Object[] )
at Sitecore.Pipelines.CorePipeline.Run(PipelineArgs args)
at Sitecore.Resources.Media.Media.GetStreamFromPipeline(MediaOptions options, Boolean& canBeCached)

6796 02:02:05 ERROR Could not run the ‘getMediaStream’ pipeline for ‘/ImagePath/’. Original media data will be used.
Exception: System.OverflowException
Message: Arithmetic operation resulted in an overflow.
Source: Sitecore.Kernel
at Sitecore.ImageLib.ThumbMaker.GetSourceByteAt(Int32 x, Int32 y)
at Sitecore.ImageLib.ThumbMaker.IndexedRezise(Int32 xSize, Int32 ySize, Boolean preserveResolution)
at Sitecore.ImageLib.Resizer.ResizeGif(Bitmap image, Size imageSize, Size frameSize, Color frameColor, Boolean preserveResolution)
at Sitecore.ImageLib.Resizer.Resize(Bitmap bitmap, Size imageSize, Size frameSize, Color frameColor, Boolean preserveResolution, ImageFormat format, InterpolationMode interpolationMode, CompositingMode compositingMode, PixelOffsetMode pixelOffsetMode)
at Sitecore.ImageLib.Resizer.Resize(Bitmap bitmap, ResizeOptions options, ImageFormat format, InterpolationMode interpolationMode)
at Sitecore.Resources.Media.ImageEffectsResize.ResizeImageStream(Stream inputStream, TransformationOptions options, ImageFormat outputFormat)
at Sitecore.Resources.Media.ResizeProcessor.Process(GetMediaStreamPipelineArgs args)
at (Object , Object[] )
at Sitecore.Pipelines.CorePipeline.Run(PipelineArgs args)
at Sitecore.Resources.Media.Media.GetStreamFromPipeline(MediaOptions options, Boolean& canBeCached)

We spent sometime identifying what’s going on. But we couldn’t. Same is the case with you? Then this post is for you. Because later on we figured out with some help

Solution:

As a developer we did quick Google Search and found this thread : https://community.sitecore.net/developers/f/8/t/382

But it didn’t helped. While writing I can see someone replied on 30th October. But our approach is bit different than that. So, thought to write.

Next step was to raise a Sitecore support case.  And they have told us that this a BUG, and provided hot-fix as well. Here’s what Sitecore support folks said:

The issue occurs if the <sc:image> tag (for example), which used to render *.gif images, contains the parameters that cause the resize of the image (e.g. “mw”, “mh” for xslt rendering or the “maxWidth”,etc for the sublayout). 

To fix issue please try the following:

  • Put attached Sitecore.Support.389864.dll to the Website\bin folder
  • Put attached Sitecore.Support.389864.config to the Website\App_Config\Include folder 
Please note that this patch was not deeply tested and we recommend you to back up your solution before applying any changes.
In summary, this error will happen  when you have gif images and while rendering it you try to resize it. Solutions are :
  1. Make it PNG – No deployment required
  2. Apply Sitecore provided hotfix — Deployment and testing required

I won’t attach files here. I would recommend you to get it via Sitecore support. But if you need it. Let me know.

Special thanks to Nikki who worked on this issue

Happy Sitecoring! 😉

Advertisements

6 Comments

Leave a Comment
  1. baernhard / Nov 24 2015 4:15 pm

    Which Sitecore Version is affected? 6.6 / 7.x / 8.x?

  2. Abhishek S / Dec 17 2015 8:44 pm

    Thank you for sharing this. We had this come up on our PROD today and we found this blog helpful.

  3. Dave / Mar 10 2016 4:07 pm

    Hi,

    I’ve been having this issue on our website as well.
    Could you send me the support package please?

    Kind Regards,
    Dave Lux

    • kiranpatils / Apr 2 2016 12:24 am

      I can. But I would recommend you to get it via Sitecore. You can provide our Reference Ticket #

      Thanks,
      Kiran

      • Dave / Apr 2 2016 1:39 am

        Hi Kiran,

        Thnx for the reply. Already have it from sitecore with your reference. Works flawlessly. 😄

      • kiranpatils / Apr 2 2016 10:42 am

        Awesome

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: