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 273 posts 490 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 659 posts 1546 karma points c-trib
    Mar 18, 2015 @ 12:54
    Rasmus Fjord
    0

    You ever got this working ?

  • This forum is in read-only mode while we transition to the new forum.

    You can continue this topic on the new forum by tapping the "Continue discussion" link below.

Please Sign in or register to post replies