File tree Expand file tree Collapse file tree 2 files changed +15
-8
lines changed Expand file tree Collapse file tree 2 files changed +15
-8
lines changed Original file line number Diff line number Diff line change 7878 useWebWorker : useWebWorker ,
7979 onProgress : onProgress
8080 }
81- imageCompression ( file , options ) . then ( function ( output ) {
82- logDom . innerHTML += ', output size:' + ( output . size / 1024 / 1024 ) . toFixed ( 2 ) + 'mb'
83- console . log ( 'output' , output )
84- const downloadLink = URL . createObjectURL ( output )
85- logDom . innerHTML += ' <a href="' + downloadLink + '" download="' + file . name + '">download compressed image</a>'
86- document . getElementById ( 'preview-after-compress' ) . src = downloadLink
87- return uploadToServer ( output )
88- } )
81+ imageCompression ( file , options )
82+ . then ( function ( output ) {
83+ logDom . innerHTML += ', output size:' + ( output . size / 1024 / 1024 ) . toFixed ( 2 ) + 'mb'
84+ console . log ( 'output' , output )
85+ const downloadLink = URL . createObjectURL ( output )
86+ logDom . innerHTML += ' <a href="' + downloadLink + '" download="' + file . name + '">download compressed image</a>'
87+ document . getElementById ( 'preview-after-compress' ) . src = downloadLink
88+ return uploadToServer ( output )
89+ } )
90+ . catch ( function ( error ) {
91+ alert ( error . message )
92+ } )
8993
9094
9195 function onProgress ( p ) {
Original file line number Diff line number Diff line change 8787 document . getElementById ( 'preview-after-compress' ) . src = downloadLink
8888 return uploadToServer ( output )
8989 } )
90+ . catch ( function ( error ) {
91+ alert ( error . message )
92+ } )
9093
9194 function onProgress ( p ) {
9295 console . log ( 'onProgress' , p )
You can’t perform that action at this time.
0 commit comments