Copied to clipboard

Flag this post as spam?

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


  • Travis Schoening 47 posts 173 karma points
    May 08, 2021 @ 18:03
    Travis Schoening
    0

    Resize Image Cropper source image

    Is there an easy way to resize the image that is served up in the image cropper itself?

    I ask because I have a scenario where a lot of high-resolution photos will be saved, and I don't necessarily want a 10mb+ file to have to be requested for each image cropper instance. I have the media currently in Azure blob storage.

    To add to that question, is it possible to utilize a CDN for this image request as well?

    Any help is much appreciated!

  • Marc Goodson 2141 posts 14344 karma points MVP 8x c-trib
    May 09, 2021 @ 07:20
    Marc Goodson
    1

    Hi Travis

    Is this purely for the backoffice editing experience?

    When an editor uploads an image, and then wants to manipulate the crops, the file is just tooo big and slows things down?

    (eg vs on the front end, once the image is requested and processed via Image Processsor, the result is cached (and can also be in blob storage) - so the large images aren't processed each time).

    One possibility then is to handle the MediaService Saving event, which fires before the image is saved, 'do your resizing there' - so that the final image uploaded into Umbraco is still 'great' for the web, but much smaller in size.

    There was a great article about options for post and pre processing images in Umbraco by James M South (creator of ImageProcessor!) which is worth a read:

    https://24days.in/umbraco-cms/2014/all-your-images-are-belong-to-umbraco/

    and Paul Seal has blogged a similar approach here: https://codeshare.co.uk/blog/automatically-resize-your-media-images-in-umbraco/

    regards

    Marc

  • Travis Schoening 47 posts 173 karma points
    May 09, 2021 @ 14:14
    Travis Schoening
    0

    Appreciate the response Marc, thanks! I've done something like that in the past (Also because I wanted to keep the original regardless of size but still serve up a smaller "working" image" But even then, I didn't see the benefit of serving up a 2-5mb image (instead of 20mb) each time other than maybe the scaling feature when cropping.

    I was just thinking there was a way to append a resize to the image source, that is, without touching the umbraco folder js services.

  • Paul Seal 524 posts 2889 karma points MVP 6x c-trib
    May 09, 2021 @ 17:29
    Paul Seal
    2

    Hi Travis Have a look at my package called smaller images. On saving an image you can resize it and set the config for what size to save images to and choose whether to keep the original or not.

    Cheers

    Paul

  • Travis Schoening 47 posts 173 karma points
    May 09, 2021 @ 17:56
    Travis Schoening
    0

    Awesome, thanks Paul, will definitely try that out, looks like it's what I'm looking for mostly.

Please Sign in or register to post replies

Write your reply to:

Draft