Bug 459273

Summary: Layer thumbnail display error
Product: [Applications] krita Reporter: thetwo <thetwo222>
Component: * UnknownAssignee: Dmitry Kazakov <dimula73>
Status: RESOLVED FIXED    
Severity: normal CC: 1012468643, acc4commissions, dimula73, ex_hunter, lynx.mw+kde, mangatengu, ss93078
Priority: NOR    
Version: 5.1.1   
Target Milestone: ---   
Platform: Microsoft Windows   
OS: Microsoft Windows   
Latest Commit: Version Fixed In:
Bug Depends on:    
Bug Blocks: 461727    
Attachments: bug

Description thetwo 2022-09-17 13:23:05 UTC
Created attachment 152151 [details]
bug

SUMMARY
1.create a new file
2.fill a color on canvas
3.we can find that the thumbnail larger
Comment 1 Dmitry Kazakov 2022-09-19 12:22:47 UTC
That is the same bug as bug 457562. Perhaps we should give it some priority...
Comment 2 Dmitry Kazakov 2022-09-19 12:25:20 UTC
*** Bug 457562 has been marked as a duplicate of this bug. ***
Comment 3 Dmitry Kazakov 2022-09-20 08:33:01 UTC
Git commit 9b7318c13298e2fc52b52ac0d760a62152d4a838 by Dmitry Kazakov.
Committed on 20/09/2022 at 08:24.
Pushed by dkazakov into branch 'master'.

Make sure that thumbnails are generated from exactBounds()

Now the layer thumbnails are generated only at the very end of the stroke,
that is, when the image is idle. It makes it possible to use more
expensive exactBounds() routine for the thumbnails update.

M  +1    -1    libs/image/kis_paint_device.cc
M  +15   -4    plugins/dockers/layerdocker/LayerBox.cpp
M  +5    -1    plugins/dockers/layerdocker/LayerBox.h

https://invent.kde.org/graphics/krita/commit/9b7318c13298e2fc52b52ac0d760a62152d4a838
Comment 4 Protoniv 2022-09-26 12:16:29 UTC
Hi, I've find a minor regression after the fix: 
Erase on the layer will add empty space on thumbnail, but did not change the proportion, which cause thumbnail distort.

Step to reproduce:
1) Draw a circle on the right side of canvas, then erase on the left side of canvas
2) We can see the circle layer thumbnail distort

krita-5.2.0-prealpha-c79f718865.appimage
Comment 5 Lynx3d 2022-09-28 15:53:13 UTC
Reopening, because it was reverted due to crashes (see bug 459510)
Comment 6 Dmitry Kazakov 2022-11-11 13:14:58 UTC
Git commit 1245a9a09ed53f4027ddb5a22ea1c9a3ecf46a10 by Dmitry Kazakov.
Committed on 11/11/2022 at 12:56.
Pushed by dkazakov into branch 'master'.

Make sure that thumbnails are generated from exactBounds()

Now the layer thumbnails are generated only at the very end of the stroke,
that is, when the image is idle. It makes it possible to use more
expensive exactBounds() routine for the thumbnails update.

M  +1    -1    libs/image/kis_paint_device.cc
M  +15   -4    plugins/dockers/layerdocker/LayerBox.cpp
M  +5    -1    plugins/dockers/layerdocker/LayerBox.h

https://invent.kde.org/graphics/krita/commit/1245a9a09ed53f4027ddb5a22ea1c9a3ecf46a10
Comment 7 vanyossi 2023-01-04 01:15:40 UTC
*** Bug 463186 has been marked as a duplicate of this bug. ***
Comment 8 Freya Lupen 2023-06-20 22:59:26 UTC
*** Bug 419830 has been marked as a duplicate of this bug. ***
Comment 9 acc4commissions 2023-06-21 01:06:39 UTC
Isn't the thumbnail generation before the patch is technically more 'correct' way? Because the pixel data is still there on the layer even it it's transparent and invisible. 
Not that I have a big problem with the patch, but I liked the fact that I could judge the actual layer size with the thumbnail...
Comment 10 Manga Tengu 2023-06-21 15:02:44 UTC
(In reply to acc4commissions from comment #9)
> Isn't the thumbnail generation before the patch is technically more
> 'correct' way? Because the pixel data is still there on the layer even it
> it's transparent and invisible. 
> Not that I have a big problem with the patch, but I liked the fact that I
> could judge the actual layer size with the thumbnail...
As a painter, I wouldn't care about this until I find my file is abnormally heavy for all it contains.
Shouldn't the layer be resized when empty ?
Maybe a manual action could be triggered ("compress file") at user's will ?
Or a dev option to see the real size of the layer in the thumbnails.

For me, as a painter, having inefficient thumbnails is a real concern. I would enjoy a file that is just as big as necessary and If I find my file too big because I know of this issue I would crop the file if it shrinks its size.