Copied to clipboard

Flag this post as spam?

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


  • Lasse Stengaard Bisbjerg 2 posts 22 karma points
    Jan 23, 2014 @ 15:56
    Lasse Stengaard Bisbjerg
    0

    CropUp Responsive fetches new picture twice

    Hi,

    I'm trying to get the responsive, i.e. client side features of CropUp to work on Umbraco 6.1.6 and ASP.NET 4.5.

    CropUp is version 1.0b9

    It appears, that each time a new image is downloaded from the server, as per upscalestep setting, the image is fetched twice.

    I call the client side CropUpHtml.CropUpResponsive method like this:

    @CropUpHtml.CropUpResponsive(media.Url, cssClass: "resizable", upscaleStep: upscaleStep, style: "width:100%;height:200px", cropAlias: "fullwidth");
    

    This produces the following output:

    <script type="text/javascript" src="/Scripts/CropUp.js"></script>
    <div style="width: 100%; height: 200px; position: relative; overflow: hidden;" class="crop-up resizable loaded" data-gravity="0.1496484,0.4100694" data-box="0,0,1,1" data-zoom="true" data-upscale-url="/CropUp/{w}x{h}R/media/1011/sample.jpg" data-upscale-step="200"><img style="position: absolute; width: 1204px; height: 677px; left: 0px; top: -178px;" src="/CropUp/1400x400R/media/1011/sample.jpg"></div>
    

    This actually seems to work as expected. Initially a small 200 by 200 images is always downloaded, but that is acceptable load wise. But upon window resizing beyond the specified upscale step of 200px, a new image is downloaded twice, which is a bit of a problem on mobile devices.

    Has someone in the community tried the CropUp Responsive bit?

    Thanks.

    /Lasse

Please Sign in or register to post replies

Write your reply to:

Draft