Skip to main content

Resize an image on the Server size before upload

Comments

4 comments

  • Ido

    Hi

     

    Any resizing of the image that is done before the upload, cannot be done by Cloudinary.

    What comes close to what you want to achieve is our incoming transformations which allow performing the transformation upon uploading itself.

    Hope that helps. 

    0
  • culturalcare-dev

    This is what i am doing

     

    var uploadParams = new ImageUploadParams
    {
    UseFilename = true,
    UniqueFilename = false,
    Folder = "test" + " / ",
    PublicId = Guid.NewGuid().ToString(),
    EagerTransforms = new List<Transformation>()
    {
    new Transformation().Quality("auto:eco")
    },
    File = new FileDescription(@"C:\blah\_DSC0093.JPG")
    };

    var uploadResult = _cloudinaryClient.Value.Upload(uploadParams);

    0
  • culturalcare-dev

    In fact the exception comes back as JsonObj = {{
    "error": {
    "message": "File size too large. Got 14820334. Maximum is 10485760."
    }
    }}

     

    So it does not change the file size before an upload

    0
  • Ido

    Hi

    The error you share indeed show that the image size is above the maximum allowed for upload for the account.

    Eager transformations are transformations that are performed after the upload is occurring. Incoming transformations are transformations that happen upon uploading, so the image with the transformation will be considered as an original in the account.

    Note that both these approaches don't resize the image before the upload. Any change to the image before the upload needs to be performed by an external way.

    does that make sense?

    0

Post is closed for comments.