Copied to clipboard

Flag this post as spam?

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


  • Dan 1288 posts 3921 karma points c-trib
    Feb 28, 2013 @ 12:56
    Dan
    0

    Constrain image upload dimensions and delete original

    Hi,

    I've maybe missed this somewhere, but I wondered if there's a way currently to save an instance of a dimensionally-constrained image upon saving to the media section, then deleting the original.  In a practical example, what I'm trying to do is prevent clients uploading photos directly from their camera into the media section of their website at their original size.  Ideally what I want to do is to constrain each image to a maximum of 800px in the maximum dimension, save this resized/constrained version (possibly optimise at this point too) then delete the original.

    I know I could use imagegen or similar to resize images dynamically but I'd rather not be storing original large/high-res image that are never required at that resolution.  I'd also like the customer not to have to worry about resizing manually before upload.

    Any ideas appreciated.  Thanks.

  • Jan Skovgaard 11280 posts 23678 karma points MVP 11x admin c-trib
    Feb 28, 2013 @ 15:00
    Jan Skovgaard
    100

    Hi Dan

    I think you should use the API and hook in to the some of the events to do the resizing before the image is being saved so you don't risk having large images take up a lot of disk space.

    So in C# you should be able to make some constraints and then you should of course use croup and imagegen to make sure the images are in the correct size when displayed on the webpage.

    Does that make any sense?

    /Jan

  • Dan 1288 posts 3921 karma points c-trib
    Feb 28, 2013 @ 15:15
    Dan
    0

    Yeah, thanks Jan, it makes a lot of sense.  I wondered if there was anything that already does this, but I guess not.  I would like to have a look at the new v6 API actually so maybe it's an excuse to do that :)

Please Sign in or register to post replies

Write your reply to:

Draft