mirror of
https://github.com/status-im/status-desktop.git
synced 2025-01-10 22:36:24 +00:00
feat: resize images and remove EXIF data - UNSAFE
This commit is contained in:
parent
a32a156651
commit
7115a1bed6
@ -1,4 +1,4 @@
|
||||
import NimQml, Tables, json, sequtils, chronicles, times, re, sugar, strutils
|
||||
import NimQml, Tables, json, sequtils, chronicles, times, re, sugar, strutils, os
|
||||
|
||||
import ../../status/status
|
||||
import ../../status/accounts as status_accounts
|
||||
@ -110,7 +110,9 @@ QtObject:
|
||||
|
||||
proc sendImage*(self: ChatsView, imagePath: string) {.slot.} =
|
||||
let image = replace(imagePath, "file://", "")
|
||||
self.status.chat.sendImage(self.activeChannel.id, image)
|
||||
let tmpImagePath = image_resizer(image, 2000)
|
||||
self.status.chat.sendImage(self.activeChannel.id, tmpImagePath)
|
||||
removeFile(tmpImagePath)
|
||||
|
||||
proc activeChannelChanged*(self: ChatsView) {.signal.}
|
||||
|
||||
|
@ -82,10 +82,11 @@ Rectangle {
|
||||
visible: !isCompact
|
||||
//% "No messages"
|
||||
text: {
|
||||
if(contentType == Constants.imageType){
|
||||
return qsTr("Image");
|
||||
switch(contentType){
|
||||
case Constants.imageType: return qsTr("Image");
|
||||
case Constants.stickerType: return qsTr("Sticker");
|
||||
default: return lastMessage ? Emoji.parse(lastMessage, "26x26").replace(/\n|\r/g, ' ') : qsTrId("no-messages")
|
||||
}
|
||||
return lastMessage ? Emoji.parse(lastMessage, "26x26").replace(/\n|\r/g, ' ') : qsTrId("no-messages")
|
||||
}
|
||||
clip: true // This is needed because emojis don't ellide correctly
|
||||
anchors.right: contactNumberChatsCircle.left
|
||||
|
Loading…
x
Reference in New Issue
Block a user