Skip to content

Commit

Permalink
del compressor
Browse files Browse the repository at this point in the history
  • Loading branch information
wujiasheng03 committed Mar 29, 2024
1 parent af538c1 commit 756a821
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 21 deletions.
1 change: 0 additions & 1 deletion frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
"dependencies": {
"@toast-ui/vue-image-editor": "^1.0.2",
"axios": "^0.27.2",
"compressorjs": "^1.2.1",
"crypto": "^1.0.1",
"monaco-editor": "^0.26.1",
"socket.io-client": "^3.1.3",
Expand Down
20 changes: 0 additions & 20 deletions frontend/src/components/form/AttachmentsList.vue
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
:format="['jpg','jpeg','png','gif','bmp','wbmp','webp','tif','psd']"
accept=".jpg,.jpeg,.png,.gif,.bmp,.wbmp,.webp,.tif,.psd"
:show-upload-list="false"
:before-upload="handleBeforeUpload"
>
<Tooltip
placement="right"
Expand All @@ -32,7 +31,6 @@
<script>
import AttachmentItem from '@/components/form/AttachmentItem.vue'
import ExportAttachmentItem from '@/components/form/ExportAttachmentItem.vue'
import Compressor from "compressorjs"
export default {
components: {
Expand All @@ -58,24 +56,6 @@ export default {
},
addExportAttachment (exportAttachment) {
this.$store.dispatch('addExportAttachment', exportAttachment)
},
handleBeforeUpload (file) {
return new Promise((resolve, reject) => {
let isLt1M = file.size / 1024 / 1024 < 2;
if (isLt1M) {
resolve(file);
} else {
new Compressor(file, {
quality: 0.8,
success: res =>{
resolve(new File([res], res.name, {type: res.type, lastModified: res.lastModified}));
},
error(err) {
reject(err)
}
});
}
});
}
}
}
Expand Down

0 comments on commit 756a821

Please sign in to comment.