Adds filename to miniatures of non-image documents.

Signed-off-by: Cyrille Bollu <cyrpub@bollu.be>
pull/657/head
Cyrille Bollu 2019-08-26 16:17:02 +02:00
rodzic 8e28e75e96
commit a39e731977
1 zmienionych plików z 7 dodań i 1 usunięć

Wyświetl plik

@ -645,6 +645,12 @@ export default {
canvas.height = imgHeight
ctx.drawImage(this, 0, 0, imgWidth, imgHeight)
// Add filename to generic icon for non image document
if ( ! e.target.result.startsWith("data:image") ) {
ctx.font = "12px Arial"
ctx.fillText(file.name, 30, height - 20)
}
// Save miniature
self.miniatures.push(canvas.toDataURL())
@ -657,7 +663,7 @@ export default {
if ( e.target.result.startsWith("data:image") ) {
img.src = e.target.result
} else {
img.src = OC.generateUrl('svg/core/filetypes/x-office-document?color=000000')
img.src = OC.generateUrl('svg/core/filetypes/x-office-document?color=d8d8d8')
}
}