0

How can i get image's new dimension when it's resized. Imagesizer doesn't return resized image 's new dimension? Should i take it as this link? How to get the image dimension from the file name

        ImageJob imageJob = new ImageResizer.ImageJob(file, "~/uploads/prods/<guid>.<ext>", new ImageResizer.ResizeSettings(
                    "width=700;quality=100;format=jpg;mode=max"));
        imageJob.CreateParentDirectory = true; //Auto-create the uploads directory.

        //i need new height value for image
        imageJob.Build();
Community
  • 1
  • 1
Yargicx
  • 1,704
  • 3
  • 16
  • 36

1 Answers1

0

ImageResizer has source.width and source.height properties which you can request after the image is resized:

ImageResizer.ImageJob i = new ImageResizer.ImageJob(filename, 
    new string[] { "source.width", "source.height" });
i.Build();

int width = Convert.ToInt32(i.ResultInfo["source.width"]);
int height = Convert.ToInt32(i.ResultInfo["source.height"]);
user2316116
  • 6,726
  • 1
  • 21
  • 35