前端進行圖片壓縮並傳入後臺

步驟:1. 將圖片轉成image對象;2. 壓縮成設置的最大尺寸;3. 經過canvas轉成base64碼;4. 後臺(此處是java)進行base64解碼存儲。如下上具體代碼。前端代碼:https://github.com/ChpShy/single-play-demo/tree/master/ImageCompress後臺代碼:https://github.com/ChpShy/single-
相關文章
相關標籤/搜索