- Timestamp:
- 2021-11-24T15:13:46+13:00 (2 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/trunk/model-interfaces-dev/atea/ocr/src/components/EditPage.vue
r35743 r35746 23 23 </table> 24 24 25 <img ref="image" :src=" imageUrl" class="image" :style="{ filter: filterString }" />25 <img ref="image" :src="src" class="image" :style="{ filter: filterString }" /> 26 26 </div> 27 27 </div> 28 28 29 29 <div class="control-panel"> 30 <button class="btn-fab" @click="$emit('closeRequested')"> 30 <button class="btn-fab" @click="$emit('closeAndDiscard')"> 31 <span class="material-icons mdi-l">cancel</span> 32 </button> 33 34 <button class="btn-fab" @click="closeAndSave"> 31 35 <span class="material-icons mdi-l">save</span> 32 36 </button> … … 151 155 }, 152 156 props: { 153 image: File 154 }, 157 imageBuffer: ArrayBuffer, 158 src: String 159 }, 160 emits: [ "closeAndDiscard", "closeAndSave" ], 155 161 data() { 156 162 return { 157 imageUrl: URL.createObjectURL(this.image),158 163 invert: false, 159 164 rotation: 0, … … 183 188 }, 184 189 methods: { 185 async getImageBlobAsync() {186 const buffer = Buffer.from(this.image .arrayBuffer());190 async closeAndSave() { 191 const buffer = Buffer.from(this.imageBuffer); 187 192 const that = this; 188 193 … … 193 198 } 194 199 195 //if (that.rotation !== 0) {196 // image.rotate(that.rotation);197 //}200 if (that.rotation !== 0) { 201 image.rotate(-that.rotation); 202 } 198 203 199 204 return await image.getBufferAsync(Jimp.MIME_PNG); 200 205 }); 201 206 202 return new Blob([ modifiedBuffer ], { type: Jimp.MIME_PNG });207 this.$emit("closeAndSave", modifiedBuffer, Jimp.MIME_PNG); 203 208 }, 204 209
Note:
See TracChangeset
for help on using the changeset viewer.