Copied to clipboard

Flag this post as spam?

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


  • Mathias Poulsen 18 posts 139 karma points
    Mar 10, 2016 @ 10:10
    Mathias Poulsen
    0

    Uploading image to image cropper with presets programmatically issue

    Hey,

    I am building an import, that should upload images to the Image Cropper property.

    This is working fine more or less, i am setting a stream as the property value and the image get uploaded.

    However, when i try to use one of my presets, the image url is standard like:

    /media/1004/r-37037.jpg?anchor=center&mode=crop

    BUT, if i go to my node in Umbraco, click one of the presets, change something and save, it seem to work and my image gets cropped.

    /media/1001/r-41058.jpg?crop=0,0.11872372000989365,0,0.28523474687921174&cropmode=percentage

    So my question is how do i "activate" the presets programmaticly? Going to each and every 2000 nodes and changing 6 presets and saving is not an option..

    • Mathias
  • Mathias Poulsen 18 posts 139 karma points
    Mar 10, 2016 @ 10:19
    Mathias Poulsen
    100

    Ok i figgered it out.

    I put in same width and height as my presets in the GetCropUrl function, so regardless of me editing the preset or not, the image gets cropped to the same size.

Please Sign in or register to post replies

Write your reply to:

Draft