Bug 464833

Summary: Pasting long data-uri based image creates too large dialog
Product: [Applications] krita Reporter: FiXato <fixato+key+bugtracker>
Component: * UnknownAssignee: Krita Bugs <krita-bugs-null>
Status: RESOLVED FIXED    
Severity: normal CC: qampidh
Priority: NOR    
Version First Reported In: 5.1.5   
Target Milestone: ---   
Platform: Microsoft Windows   
OS: Microsoft Windows   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:
Attachments: Screenshot of Krita download image dialog that's taller than the current screen's resolution.

Description FiXato 2023-01-25 23:18:04 UTC
Created attachment 155646 [details]
Screenshot of Krita download image dialog that's taller than the current screen's resolution.

When trying to paste a data-uri based image copied from a browser, the "do you want to download the image at data:image/jpeg:base64,/long base 64 string here/" dialog that is opened, can end up being too tall for the screen, obscuring the Yes / No buttons at the bottom.
This dialog also can't be resized, or scrolled, making it hard to agree or disagree unless you know to press Y or N.
Putting the source URL in a scrollable text UI element would probably go a long way towards improving the usability. 


STEPS TO REPRODUCE
1. Find an image in your browser that is embedded using a data-URI. The image results of Google Image Search is the source I used when I encountered this bug.
2. Right-click the image and select "Copy Image"
3. Open Krita and select "Paste into new image"
4. In the next dialog, select "Download from the remote source"
5. The too tall dialog is now displayed.

OBSERVED RESULT
A dialog is shown with the question "Do you want to download the image at data:image/jpeg:base64,/long base 64 string here/", where the base64 string is so long that it makes the dialog taller than my 3840x2160 display, bringing the Yes / No buttons out of view and reach.

EXPECTED RESULT
The dialog should not exceed the current screen's dimensions, and the URL should either be in a scrollable UI element, or cropped.


SOFTWARE/OS VERSIONS
Windows: Windows 11
Comment 1 Kampidh 2023-01-26 13:54:50 UTC
Hi, confirmed the bug with Krita version 5.1.5 and latest 5.2.0-prealpha (git 7464a3920f).

I'll try to take a look on it.
Comment 2 Bug Janitor Service 2023-01-26 14:05:36 UTC
A possibly relevant merge request was started @ https://invent.kde.org/graphics/krita/-/merge_requests/1724
Comment 3 Invent Merge Service 2023-01-29 13:26:36 UTC
Git commit f3e37a9acfff72a27a1e8c04aace3456fae3644c by Merge Service, on behalf of Rasyuqa A. H.
Committed on 29/01/2023 at 13:25.
Pushed by merge-service into branch 'master'.

RemoteFileFetcher: remove data URI preview to prevent screen overflow
Part-of: <https://invent.kde.org/graphics/krita/-/merge_requests/1724>

M  +6    -3    libs/ui/KisRemoteFileFetcher.cpp
M  +6    -1    libs/ui/kis_clipboard.cc

https://invent.kde.org/graphics/krita/commit/f3e37a9acfff72a27a1e8c04aace3456fae3644c