public void SaveMiniPhoto(Image img, Attachment photo)
        {
            Image  resizedImg;
            string fname = Attachment.ConstructFullFilePath(photo, "M");

            //Path.Combine(HostingEnvironment.MapPath("~/Uploads/"), photo.Id + "-" + photo.ParentObjectId + "M.jpg");
            resizedImg = resizeImageToSquare(img, 100);
            resizedImg.Save(fname, format: ImageFormat.Jpeg);
        }
        public void SaveBigPhoto(Image img, Attachment photo)
        {
            Image  resizedImg;
            string fname = Attachment.ConstructFullFilePath(photo, "B");

            //Path.Combine(HostingEnvironment.MapPath("~/Uploads/"), photo.Id + "-" + photo.ParentObjectId + "B.jpg");
            resizedImg = resizeImageKeepAcpectRatio(img, 1920);
            resizedImg.Save(fname, format: ImageFormat.Jpeg);
        }
 public void DeleteMiniPhoto(Attachment photo)
 {
     System.IO.File.Delete(Attachment.ConstructFullFilePath(photo, "M"));
 }