Copied to clipboard

Flag this post as spam?

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


  • David Conlisk 432 posts 1008 karma points
    Aug 26, 2013 @ 17:14
    David Conlisk
    0

    Automatically update all crops?

    Hi all,

    I have a site with 1,000s of contact images. I'm using a Contact_Image crop when displaying them. This crop was at 100x100 pixels in size, but now I need to update this to 100x150. I've tried using the Create Crops tool, but I don't think that this is designed for this purpose, i.e. I don't think it recreates crops in this situation? Please correct me if I'm wrong!

    I tried deleting all Contact_Image crops from the file system but the recreated crops are incorrect. I can see that in the umbraco.config the crop exists and has the x and y co-ordinates in there, and I don't know how I can update these properly.

    Any ideas?

    Thanks!

    David

  • Jeroen Breuer 4908 posts 12265 karma points MVP 4x admin c-trib
    Aug 26, 2013 @ 17:45
    Jeroen Breuer
    0

    Hello,

    Create Crops should work in this situation. Did you watch this demo to see what it can be used for? http://www.screenr.com/0zUs

    However it's an old package and I don't think it works in Umbraco v6, but for v4 it's no problem. I haven't tested it on v6, because when I switched to v6 I started using CropUp.

    Jeroen

  • David Conlisk 432 posts 1008 karma points
    Aug 26, 2013 @ 18:39
    David Conlisk
    0

    Hi Jeroen,

    Weird, I thought I'd deleted this post and added it to this thread: http://our.umbraco.org/projects/backoffice-extensions/image-cropper/image-cropper/10914-is-there-a-way-to-republish-all-your-image-crops

    Anyway, looking at that video and reading the explanation of what Create Crops does (the text that appears below the Create Crops button) it doesn't seem to me like Create Crops will recreate existing crops, and the video shows only new crops being added. I have shared code that relies on the name of the crop being the same, but the size needs to be updated from what is currently in umbraco.config and on the file system. Do you have any idea how I could achieve that? 

    Thanks,

    David

  • David Conlisk 432 posts 1008 karma points
    Aug 26, 2013 @ 18:39
    David Conlisk
    0

    Oh I meant to mention I'm using v4.11, not v6.x

  • Dan 1285 posts 3917 karma points c-trib
    Aug 06, 2014 @ 19:09
    Dan
    0

    I have the same issue.  1000+ images in the media section, added a new crop alias but the crops aren't automatically available - it seems to need each image re-saving manually to generate the crop data.

    Has anybody found a way to automatically regenerate crops?

  • Jeroen Breuer 4908 posts 12265 karma points MVP 4x admin c-trib
    Aug 07, 2014 @ 09:51
    Jeroen Breuer
    0

    Did you try Create Crops like I mentioned here?

    Jeroen

  • Dan 1285 posts 3917 karma points c-trib
    Aug 07, 2014 @ 10:19
    Dan
    0

    Thanks Jeroen, I watched the screenr but was a bit unsure as to whether that package adds a proprietary level of crops on top of the core cropper values.  Does it literally just add the required JSON to all of the media items, same as the standard cropper?

    The other question is, will that package work with 7.1.3?

    Many thanks.

  • Jeroen Breuer 4908 posts 12265 karma points MVP 4x admin c-trib
    Aug 07, 2014 @ 10:22
    Jeroen Breuer
    0

    Sorry Create Crops won't work on v7. This is an old topic so I though you talked about the Image Cropper that is part of the v4 and v6 core. I don't have a solution for the v7 Image Cropper.

    Jeroen

  • Dan 1285 posts 3917 karma points c-trib
    Aug 07, 2014 @ 10:23
    Dan
    0

    Ah, that's a shame :(  Thanks anyhow.

  • Jeroen Breuer 4908 posts 12265 karma points MVP 4x admin c-trib
    Aug 07, 2014 @ 10:27
    Jeroen Breuer
    0

    You could have a look at the Create Crops source. There is some code that get's all the media items (with the old API) and than resave each media item to make sure the crops are available. It also does some other stuff but that might not be necessary if only saving is enough.

    Jeroen 

  • Dan Lister 416 posts 1974 karma points c-trib
    Oct 24, 2014 @ 10:24
    Dan Lister
    2

    Hi,

    I'm not sure if it will help but for the built in Image Cropper, I created a event handler which when a data type is saved and is of type Umbraco.ImageCropper, all content, media and member items using that data type will have their image crops synced to the pre value crops stored in the data type being saved.

    The code is bit long winded but https://gist.github.com/danlister/2c3ceb1a66a706ef0913 should show work.

    Thanks, Dan.

Please Sign in or register to post replies

Write your reply to:

Draft