Bug 402978

Summary: Fill Layer with pattern loads wrong pattern after reloading image
Product: [Applications] krita Reporter: glen.boylan
Component: Layer StackAssignee: Krita Bugs <krita-bugs-null>
Status: RESOLVED FIXED    
Severity: minor CC: ahab.greybeard, scottpetrovic
Priority: NOR    
Version: 4.1.7   
Target Milestone: ---   
Platform: Microsoft Windows   
OS: Microsoft Windows   
Latest Commit: Version Fixed In:
Sentry Crash Report:

Description glen.boylan 2019-01-07 20:01:17 UTC
SUMMARY
Creating a fill layer with a pattern then saving, closing and reloading results in the fill layer having the incorrect pattern.

STEPS TO REPRODUCE
1. Create a new blank image
2. create a fill layer
3. select 'pattern' from the options and select any monochrome dither-style pattern (the greyscale patterns seem to be unaffected)
4. Layer will fill with the selected pattern.
5. Save image.
6. Close Krita.
7. Reopen Krita and the image

OBSERVED RESULT
The fill layer will show the wrong pattern. In fact it looks a little bit like it's merged 2 patterns together

EXPECTED RESULT
It should have the same pattern that was selected.

SOFTWARE/OS VERSIONS
Windows: 10 and 7
MacOS: 
Linux/KDE Plasma: 
(available in About System)
KDE Plasma Version: 
KDE Frameworks Version: 
Qt Version: 

help->system info:
------------------
Krita
  Version: 4.1.7

Qt
  Version (compiled): 5.9.3
  Version (loaded): 5.9.3

OS Information
  Build ABI: x86_64-little_endian-llp64
  Build CPU: x86_64
  CPU: x86_64
  Kernel Type: winnt
  Kernel Version: 6.1.7601
  Pretty Productname: Windows 7 SP 1 (6.1)
  Product Type: windows
  Product Version: 7sp1

OpenGL Info
  **OpenGL not initialized**

ADDITIONAL INFORMATION
Krita appears to think it is displaying the correct pattern. If you open the properties for the fill layer (F3) and select the correct pattern again and click OK, Krita will not change the pattern - i'm guessing this is because it thinks this is the currently selected one.

If I switch to another pattern and press ok then press F3 for properties again and change it back to the correct one again, this time it will work.

This bug is also (for me) in versions 4.1.2, 4.1.5 and 4.1.7. These are the only versions I've tested on.

Thanks for the amazing software though everyone. Much appreciated.
Comment 1 Scott Petrovic 2019-01-07 20:30:48 UTC
I can confirm. You don't need to close Krita. Just do the steps mentioned and save it as a KRA. Then close the image and re-open it. The pattern appears to get a small grid on top of it. The only way to get rid of it is change the pattern to something else. Not sure why it would do this
Comment 2 Ahab Greybeard 2019-01-08 02:27:46 UTC
I have two custom patterns which are .png files, both 100 x 100 showing a grid of red and blue lines. One pattern has a white background and the other has a transparent background.

The white background pattern is not affected but the transparent background pattern is affected. 

The Hexacol pattern is not monochrome (grey edges), it has a transparent background and is affected.

The transparent background may be significant?
Comment 3 glen.boylan 2019-01-08 12:24:35 UTC
Some further experimentation based on the previous 2 comments:

Krita is in fact layering another pattern, not loading the incorrect one. It's loading 'Grid01.pat' from Krita Dir\share\krita\patterns. From what Ahab says, it sounds like it's loading grid01.pat first then the correct pattern (hence greyscale patterns with transparency showing the grid01 pattern.

Interestingly, if I rename the grid pattern it fixes the problem. eg. i renamed it to grid01BAK.pat and now it works fine. That pattern is still selectable from within Krita as it just shows up with the new name. :D
Comment 4 Ahab Greybeard 2019-06-10 08:33:46 UTC
This bug has been fixed by:

Git commit 92a9a440f3a9876678ea309bf984467b33157406 by Ivan Yossi.
Committed on 07/06/2019 at 14:35.
Pushed by ivany into branch 'master'.

Remove update on creating a generator fill layer.

as reported in https://bugs.kde.org/show_bug.cgi?id=408169

Setting to Resolved