How to find reason for Generic GDI+ error when saving an image?

前端 未结 10 1569
心在旅途
心在旅途 2020-11-27 19:03

Having a code that works for ages when loading and storing images, I discovered that I have one single image that breaks this code:

const string i1Pa         


        
10条回答
  •  臣服心动
    2020-11-27 19:23

    Open in the program

    const string i1Path = @"c:\my\i1.jpg";
    
    const string i2Path = @"c:\my\i2.jpg";
    
    var i = Image.FromFile(i1Path);
    
    i.Save(i2Path, ImageFormat.Jpeg);
    
    i.Dispose();
    

提交回复
热议问题