Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Rasmus Fjord 657 posts 1542 karma points c-trib
    Feb 02, 2015 @ 21:21
    Rasmus Fjord
    0

    Getting a "value cannot be null" YSOD

    Hey there :)

    I followed the blog post on umbraco.com about slimmage/slimsy but cannot figure out why. I have the javascript in place(first load), ive installed the Slimresponse nuget package to autofix the noscript tags, im calling the image like this(its a clean umb 7.2.1) :

    <div class="slider-img">
                                 <img style="max-width:100%" src="@image.GetCropUrl(400, 400, ratioMode: ImageCropRatioMode.Height, furtherOptions: "&slimmage=true")" />
                            </div>

    The image has the the cropper set as a property replacement for the umbracoFile. Ive tried to resave the image but still getting the thing below. 

     

    Error:

    [ArgumentNullException: Value cannot be null.
    Parameter name: expression]
       ImageProcessor.Extensions.StringExtensions.ToPositiveFloatArray(String expression) +226
       ImageProcessor.Processors.Resize.ParseSize(String input) +1074
       ImageProcessor.Processors.Resize.MatchRegexIndex(String queryString) +358
       ImageProcessor.Web.<>c__DisplayClass5.<AutoProcess>b__1(IGraphicsProcessor x) +19
       System.Linq.WhereListIterator`1.MoveNext() +56
       System.Linq.Buffer`1..ctor(IEnumerable`1 source) +132
       System.Linq.<GetEnumerator>d__0.MoveNext() +110
       System.Collections.Generic.List`1..ctor(IEnumerable`1 collection) +381
       System.Linq.Enumerable.ToList(IEnumerable`1 source) +58
       ImageProcessor.Web.ImageFactoryExtensions.AutoProcess(ImageFactory factory) +259
       ImageProcessor.Web.HttpModules.<ProcessImageAsync>d__b.MoveNext() +3396
       System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) +93
       System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) +52
       System.Web.TaskAsyncHelper.EndTask(IAsyncResult ar) +60
       System.Web.AsyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +415
       System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +155

     

  • Jeavon Leopold 3005 posts 13196 karma points MVP 7x admin c-trib
    Feb 02, 2015 @ 21:25
    Jeavon Leopold
    0

    Hi Rasmus,

    Could you view the rendered url of the image in the html and paste it here?

    I'm guessing you need to resave the media after you switched it from upload to cropper.

    Jeavon

  • Rasmus Fjord 657 posts 1542 karma points c-trib
    Feb 02, 2015 @ 21:26
    Rasmus Fjord
    0

    I tried as the first thing going in just setting a new focal point and saving the image cause i thought of the same thing. 

    Here is what it spits out:

    <img style="max-width:100%" data-src="/media/1009/atlantis-win_20140828_060248.jpg?center=0.42,0.4125&amp;mode=crop&amp;width=400&amp;heightratio=1&amp;slimmage=true&amp;rnd=130673851540000000" data-slimmage="true" src="/media/1009/atlantis-win_20140828_060248.jpg?center=0.42,0.4125&amp;mode=crop&amp;width=1280&amp;heightratio=undefined&amp;slimmage=true&amp;rnd=130673851540000000" data-pixel-width="1280">
  • Jeavon Leopold 3005 posts 13196 karma points MVP 7x admin c-trib
    Feb 02, 2015 @ 21:56
    Jeavon Leopold
    0

    Hmm, and if you paste that url directly into the browser you get that YSOD, right?

  • Jeavon Leopold 3005 posts 13196 karma points MVP 7x admin c-trib
    Feb 02, 2015 @ 22:00
    Jeavon Leopold
    0

    I think its the heightratio=undefined in the data-slimmage attribute. I can't understand how that could be differnt to the data-src....!!!

  • Rasmus Fjord 657 posts 1542 karma points c-trib
    Feb 02, 2015 @ 22:03
    Rasmus Fjord
    0

    Hmm actually it works if i just paste the url in .. hmm 

    http://localhost:50742/media/1009/atlantis-win_20140828_060248.jpg?center=0.42,0.4125&amp;mode=crop&amp;width=400&amp;heightratio=1&amp;slimmage=true&amp;rnd=130673851540000000

    This is how i output it :

       <div class="slider-img">
                                 <img style="max-width:100%" src="@image.GetCropUrl(400, 400, ratioMode: ImageCropRatioMode.Height, furtherOptions: "&slimmage=true")" />
                            </div>

     

  • Jeavon Leopold 3005 posts 13196 karma points MVP 7x admin c-trib
    Feb 02, 2015 @ 22:17
    Jeavon Leopold
    0

    And with heightratio=undefined?

  • Rasmus Fjord 657 posts 1542 karma points c-trib
    Feb 02, 2015 @ 22:21
    Rasmus Fjord
    0

    If i do like this :

    @image.GetCropUrl(400, ratioMode: ImageCropRatioMode.Height, furtherOptions: "&slimmage=true")
                            

    It still fails But if i do like the above and set the cropratiomode to width instead it works but gussing its not really doing its job.

  • Jeavon Leopold 3005 posts 13196 karma points MVP 7x admin c-trib
    Feb 02, 2015 @ 22:24
    Jeavon Leopold
    0

    Is the output you posted from the rendered Html (view source) or from the DOM?

  • Rasmus Fjord 657 posts 1542 karma points c-trib
    Feb 02, 2015 @ 22:29
    Rasmus Fjord
    0

    Oh i think its from the DOM.

    this is DOM :

    /media/1009/atlantis-win_20140828_060248.jpg?center=0.42,0.4125&mode=crop&width=1280&heightratio=undefined&slimmage=true&rnd=130673851540000000

    And its not working 

    This is the source:

    /media/1009/atlantis-win_20140828_060248.jpg?center=0.42,0.4125&amp;mode=crop&amp;width=400&amp;heightratio=1&amp;slimmage=true&amp;rnd=130673851540000000

    The source works because heightratio is 1 i guess, could it be that the slimmage is not working 100%. I got the newest one off github.

    https://github.com/imazen/slimmage/blob/master/slimmage.js

  • Jeavon Leopold 3005 posts 13196 karma points MVP 7x admin c-trib
    Feb 02, 2015 @ 22:34
    Jeavon Leopold
    100

    Could be, there have been a lot of updates recently.

    Could you try with this one? https://raw.githubusercontent.com/Jeavon/Slimsy/master/Slimsy/Scripts/slimmage.js

  • Rasmus Fjord 657 posts 1542 karma points c-trib
    Feb 02, 2015 @ 22:38
    Rasmus Fjord
    0

    You are a savoir indeed ! 

    That version works, the newest just is version like 0.4.1 ish.

    THX man ! 

  • Jeavon Leopold 3005 posts 13196 karma points MVP 7x admin c-trib
    Feb 02, 2015 @ 22:51
    Jeavon Leopold
    0

    You're welcome! I'm guessing it's something to do with the new height support. Updating Slimsy to the new version of Slimmage is on my list, so I'll watch out for this (and hopefully fix it) then.

  • Rasmus Fjord 657 posts 1542 karma points c-trib
    Feb 03, 2015 @ 08:38
    Rasmus Fjord
    0

    yeah something like that :) And no worries about updating, since this post is here now and if we put up a sign on the package. The only reason why i bumped into it like this was because i followed that blog post where it said just go get it at github :)

  • Jeavon Leopold 3005 posts 13196 karma points MVP 7x admin c-trib
    Feb 25, 2015 @ 20:23
    Jeavon Leopold
    0

    FYI, I have now have a version of Slimmage v0.4.1 which works with Slimsy. You can get it from here.

Please Sign in or register to post replies

Write your reply to:

Draft