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 78
78
useWebWorker : useWebWorker ,
79
79
onProgress : onProgress
80
80
}
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
+ } )
89
93
90
94
91
95
function onProgress ( p ) {
Original file line number Diff line number Diff line change 87
87
document . getElementById ( 'preview-after-compress' ) . src = downloadLink
88
88
return uploadToServer ( output )
89
89
} )
90
+ . catch ( function ( error ) {
91
+ alert ( error . message )
92
+ } )
90
93
91
94
function onProgress ( p ) {
92
95
console . log ( 'onProgress' , p )
You can’t perform that action at this time.
0 commit comments