Copied to clipboard

Flag this post as spam?

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


  • Sean Dooley 289 posts 528 karma points
    Feb 12, 2015 @ 13:31
    Sean Dooley
    0

    Umbraco 7 API GetCropUrl returns empty string

    Within an UmbracoApiController, I'm trying to use GetCropUrl on a dynamic object with an ImageCropper property.

    Using GetCropUrl item.GetCropUrl("Image", "FullWidth"); returns the crop as expected.

    Using an exteneded version of GetCropUrl item.GetCropUrl(propertyAlias: "Image", cropAlias: "FullWidth", useCropDimensions: true, ratioMode: ImageCropRatioMode.Height, furtherOptions: "&slimmage=true" ); returns an empty string.

    public class CategoryApiController : UmbracoApiController {
    ...
    int rootId = Umbraco.TypedContentAtRoot().First().Id;
    var root = Umbraco.Content(rootId);
    var categories = rootNode.Descendants("CategoryContainer").First();
    var items = categories.Descendants("CategoryItem").Where("Visible");
    ...
    foreach (var item in Items) {
    if (item .HasValue("Image")){
    img = TipItem.GetCropUrl(
    propertyAlias: "Image",
    cropAlias: "FullWidth",
    useCropDimensions: true,
    ratioMode: ImageCropRatioMode.Height,
    furtherOptions: "&slimmage=true" );
    }
    }
    }

    Any ideas why would be greatly appreciated.

    Umbraco Version 7.2.1

  • Rasmus Fjord 675 posts 1566 karma points c-trib
    Mar 18, 2015 @ 12:54
    Rasmus Fjord
    0

    You ever got this working ?

Please Sign in or register to post replies

Write your reply to:

Draft