Skip to content

Commit

Permalink
Merge branch 'pu/je/felamimail_select_image_png_gif' into 'main'
Browse files Browse the repository at this point in the history
feature(Felamimail): add support for png and gif images to select image

See merge request tine20/tine20!6224
  • Loading branch information
sstamer committed Nov 22, 2024
2 parents 4bbbdec + 7ebe7d7 commit 6e5b146
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions tine20/library/ExtJS/src/widgets/form/HtmlEditor.js
Original file line number Diff line number Diff line change
Expand Up @@ -1037,7 +1037,7 @@ Ext.form.HtmlEditor = Ext.extend(Ext.form.Field, {
let img = new Image()
img.src = result
img.onload = () => {
this.imgOnload(img, target, max)
this.imgOnload(img, target, max, type)
}
},

Expand Down Expand Up @@ -1080,7 +1080,17 @@ Ext.form.HtmlEditor = Ext.extend(Ext.form.Field, {
let reader = new FileReader()
reader.readAsDataURL(fileBlob)
reader.onload = () => {
this.getImageBase64(reader.result, button.size, this.selectedImage).then (() => {
let type = 'image/jpeg'
switch (this.selectedImage.alt.slice(-3)) {
case 'png':
type = 'image/png'
break;
case 'gif':
type = 'image/gif'
break;
}

this.getImageBase64(reader.result, button.size, this.selectedImage, type).then (() => {
this.selectedImage.dataset.size = button.size
})
}
Expand Down

0 comments on commit 6e5b146

Please sign in to comment.