image file is truncated

上傳圖片->生成縮略圖..
出現Bug:
          image file is truncated
原因:
          PIL讀取了未上傳完的圖片..
改之前:
            destination = open(filePath, 'wb+')
            for chunk in f.chunks():
                destination.write(chunk)
改後:
            destination = open(filePath, 'wb+')
            for chunk in f.chunks():
                destination.write(chunk)
            destination.close();
 
 
 
python 切圖的示例:
改的代碼:
        
 
 
         
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章