-
Notifications
You must be signed in to change notification settings - Fork 78
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: extend/fix DND and clipboard image operations #10975
Conversation
Jenkins BuildsClick to see older builds (28)
|
I tried this PR and drag and drop works fine (though it did work for me anyway before). Pasting from Brave still doesn't work though. So #10926 is not fixed by this. I feel like this is a Brave/Qt Bug that we can't really fix |
Ah, too bad. Most likely it is a Qt bug, fancy updating your Qt version? :) I'll install Brave myself anyway and will give it a try |
0e1a4f2
to
09c02d0
Compare
@jrainville works for me :/ |
@jakubgs the
Some stale nimcache? OpenSSL upgraded? |
- getFileSize: NIM version would crash on non-existing or remote files - isValidImageUrl: properly detect file extensions when the URL contains a query (eg "file.jpeg?width=1000&height=600")
- when verifying whether an image has a suitable size or extension
- accept both the blob (`data:image/jpeg;base64` payload) or a path/URL to a local file - remove the usage of QPixmap, QImage is enough and more suitable for save/load and resizing as well - remove usage of an extra file when saving
- when the user drops a remote URL (e.g. from a webbrowser), detect it and download it before passing onto the "image_resizer" - since the "dos_image_resizer" now handles both data and URLs, we can simply forward the `imageUrl` to it - detect an invalid (empty) result from "dos_image_resizer" and don't try to send such an image
09c02d0
to
3f7460f
Compare
Works on MacOs with Safari and Chrome |
@alexjba Qt version? |
- most browsers will pass a standard `text/uri-list` MIME type, however Chrome uses `text/x-moz-url` so we handle that separately (`drop.hasUrls` is `false` in this case)
3f7460f
to
ca26330
Compare
There's been a discussion on this here: #9428 (comment) It's due importing httpclient in nim: https://github.com/status-im/status-desktop/pull/10975/files#diff-09c38470e3ca52e97f3e41aec8963c42be8b404a260f913ff24fb2930dd3b76eR2 Now we have a newer nim version AFAIK so there's a chance we can fix it. But we need to be careful not to link two different OpenSSL versions in the app because NIM doesn't support this. Using this flag could fix it: https://github.com/nim-lang/Nim/blob/devel/lib/wrappers/openssl.nim#L40. We could try to force the same version we're already linking static or dynamic, depending on platform. Another option is to do the httpClient logic in qml, c++ or go. |
The same version used on CI, 5.15.8. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
by explicitely specifying `-d:useOpenssl3` cf #9428 (comment)
f9b7ea4
to
c5d5d1e
Compare
If I use 0.12, I can still reproduce the issue. Is there any chance that we updated the QT version since then on CI? |
Yeah I think we did, not sure if for all OSs |
AFAIK only MacOs is using 5.15.8 since 0.11. Linux is still stuck to 5.15.2 (#9350) |
Interesting. I'm using 5.15.2 locally too, so that might explain why I also see the issue reproducing. I'll try updating to 5.15.8 |
Dumb question, how did you install 5.15.8 @caybro ? The online installer only gives access to 5.15.2 and 6.x |
Comes with my Linux distro :) |
Otherwise there are just source packages to download |
On MacOs we're using Homebrew to install it. It's also available on linux, so you could try with |
What does the PR do
Fixes several issues/deficiencies we had with handling image data (paste, drag'n'drop, resizing); pls see the individual commits for explanation; namely:
image_resizer
C++ code, more robust file size/extension checksAffected areas
StatusChatInput,
sendImages
Screenshot of functionality (including design for comparison)
TODO: video