This project is read-only.

Upgraded to 1.7, problem with MediaProcessing

Topics: General
Aug 10, 2013 at 4:37 PM
I just upgraded from 1.6.x to 1.7. Had a hard time with the Featured Item Slider module I'm using but now it's back on track!

I activated and used the Upgrade module for 1.7 to migrate my media. The site seems to be working fine but I have an issue with the media resizing module. When I go in the Medias section of the admin (which is the Media Library I guess), I see my folders and medias but no thumbnail or picture at all. All items are like empty container, with the frame and label only. I looked in the error log and this is what I get:
2013-08-10 11:08:17,887 [97] Orchard.MediaProcessing.Shapes.MediaShapes - An error occured while rendering shape Transform_Resize_w_200_h_200_m_crop_a_middlecenter_c_ for image /Media/Default/Accueil/logo_bz.gif
Microsoft.CSharp.RuntimeBinder.RuntimeBinderException: 'Newtonsoft.Json.Linq.JObject' does not contain a definition for 'Width'
at CallSite.Target(Closure , CallSite , Object )
at Orchard.MediaProcessing.Providers.Filters.ResizeFilter.ApplyFilter(FilterContext context) in d:\Clients\\Modules\Orchard.MediaProcessing\Providers\Filters\ResizeFilter.cs:line 31
at Orchard.MediaProcessing.Services.ImageProfileManager.GetImageProfileUrl(String path, String profileName, FilterRecord customFilter, ContentItem contentItem) in d:\Clients\\Modules\Orchard.MediaProcessing\Services\ImageProfileManager.cs:line 126
at Orchard.MediaProcessing.Shapes.MediaShapes.MediaUrl(Object Shape, Object Display, TextWriter Output, String Profile, String Path, ContentItem ContentItem, FilterRecord CustomFilter) in d:\Clients\\Modules\Orchard.MediaProcessing\Shapes\MediaShapes.cs:line 54
Any idea? I suppose it's related but the image doesn't show in my Featured Item Slider widget. If I look at the markup of the rendered page, the image tag looks like that:
<img src="{154}">

Any help would be great!
Jun 24, 2014 at 9:07 PM
I am having the same problem in version 1.7 & 1.8
Anyone found a resolution ?
Jul 1, 2014 at 11:40 PM
I found a workaround; Seems to be an issue with the system compiler causing an exception when it should be passing the code to the dynamic compiler. In ResizeFilter.cs changed the code at the beginning:
    public void ApplyFilter(FilterContext context) {

        //JSR: Fix Dynamic compiler error:  Microsoft.CSharp.RuntimeBinder.RuntimeBinderException: 'Newtonsoft.Json.Linq.JObject' does not contain a definition for 'Width'

        //int witdh = context.State.Width;
        //int height = context.State.Height;
        //string mode = context.State.Mode;
        //string alignment = context.State.Alignment;
        //string padcolor = context.State.PadColor;

        Newtonsoft.Json.Linq.JToken token = context.State;

        int witdh = (int)token.SelectToken("Width");
        int height = (int)token.SelectToken("Height");
        string mode = (string)token.SelectToken("Mode");
        string alignment = (string)token.SelectToken("Alignment");
        string padcolor = (string)token.SelectToken("PadColor");
        string dummy = (string)token.SelectToken("Dummy");