Bug 419289

Summary: Krita on master (after RR) cannot save and/or open layers with layer styles
Product: [Applications] krita Reporter: ferweer <gyrlgith>
Component: Resource ManagementAssignee: Halla Rempt <halla>
Status: RESOLVED FIXED    
Severity: normal CC: halla, tamtamy.tymona
Priority: NOR Keywords: triaged
Version First Reported In: nightly build (please specify the git hash!)   
Target Milestone: ---   
Platform: Other   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:

Description ferweer 2020-03-27 10:27:31 UTC
SUMMARY
new file > any using layer style > save > open this saving file.
you can't load layer style. empty layer.

Operating System: Kubuntu 19.10
KDE Plasma Version: 5.18.3
KDE Frameworks Version: 5.67.0
Qt Version: 5.12.4
Kernel Version: 5.3.0-42-lowlatency
OS Type: 64-bit
git db1cc49
Comment 1 ferweer 2020-03-27 10:33:51 UTC
remove all configure > dose not work.
.config/krita-scripterrc
.config/kritadisplayrc
.config/kritaarc
.config/krita(DIR)
i test 66b65ab.
Comment 2 ferweer 2020-03-27 10:34:47 UTC
sorry i mistake. i removed this directory. but dose not work.
.local/share/krita(DIR)
Comment 3 ferweer 2020-03-27 11:07:08 UTC
ok git 66b65ab can't. i think. i test other version? ok i download start for git fc06350 #817
this issue not happen on git dac91df. yes near 202502 version. an old.
something wrong. what happen?
Comment 4 ferweer 2020-03-27 11:29:12 UTC
git 44d8e02 4.3.0prealpha can load layer style. i can't remember when download this version.
git dac91df 4.2.9alpha can load layer style.
git fc06350 #817 4.3.0prealpha CAN'T LOAD LAYER STYLE.
all test environment with all krita config removed and clean.
i test end. sorry for consecutive reported.
Comment 5 Tiar 2020-03-27 11:44:33 UTC
It's part of the resource rewrite that is going on on master. Thanks for bringing it to our attention.

If you open a file that master Krita was supposed to save a layer style in and you open it in Krita 4.2.9 (or earlier version), does it open the layer style? or not?
Comment 6 ferweer 2020-03-28 03:57:28 UTC
(In reply to Tymond from comment #5)
> If you open a file that master Krita was supposed to save a layer style in
> and you open it in Krita 4.2.9 (or earlier version), does it open the layer
> style? or not?

thanks, i glad reply. and i glad if this report became one improvement report for krita development i tested git db1cc49 again.
yes, krita dosen't save kra on layerstyle. i discovery git db1cc49 generate .kra, too tiny file size.
git 44d8e02 file save 1MB(example), git db1cc49, 55KB.
and git 44d8e02, can't open generate layer style by git db1cc49. but can open file. can load except layer style only. maybe.
Comment 7 Tiar 2020-07-31 20:12:19 UTC
Hi, I checked and all the commits you mentioned that doesn't work are based on master, which means those are development builds. Please don't use them to work.

Broken:
- db1cc49ba2 (master-only) Thu Mar 26 15:28:35 2020 +0000 Scott Petrovic Change cursor to pointer on up and down arrow for sliderbox input
- fc06350be1 (master-only) Sun Mar 22 14:27:19 2020 +0100 Boudewijn Rempt Fix crash when creating an image from the clipboard

Working:
- 44d8e02 (master and krita/4.3; means it was before resource rewrite merged to master) Sun Mar 15 02:43:21 2020 +0100 l10n daemon script GIT_SILENT made messages (after extraction)
- dac91dfbe7 (there is no branch that contains this commit, I believe it's just amyspark's special appimage etc., probably before branching out from master) Sat Feb 15 09:06:31 2020 -0300 L. E. Segovia Use getUIMin/Max in the channel filters too


> can't open generate layer style by git db1cc49
You mean it cannot open Fill Layer that you created in the amyspark's special GSOC build? It's not surprising - it wasn't yet released. Only some builds have those abilities.

I will change the bug report title to note that it's about the new resource rewrite. Please if you want to use Krita for production, don't use development builds.
Comment 8 Tiar 2020-07-31 20:30:36 UTC
Note: situation on master with resource rewrite right now:
- Krita can open file with layer styles, it just won't be loaded.
- Krita can save file with layer styles, the layer style just won't be saved.
Comment 9 ferweer 2020-08-06 06:38:55 UTC
(In reply to Tymond from comment #8)
> Note: situation on master with resource rewrite right now:
> - Krita can open file with layer styles, it just won't be loaded.
> - Krita can save file with layer styles, the layer style just won't be saved.

Hi thanks. 
Krita Version: 4.3.0, Qt version compiled: 5.12.8
This version can save and load layer styles. So I using. But you right. I must not using of my work with krita development build. Sorry. So I changed krita version to distory default version.

I think, And other developer said is linux application is all must using to new version of include development version as one can. But that is different. I understanded. thanks.
Comment 10 Halla Rempt 2021-04-08 14:03:33 UTC
This is still broken. With a small test file, there's an infinite amount of messages like

Using QByteRef with an index pointing outside the valid range of a QByteArray. The corresponding behavior is deprecated, and will be changed in a future version of Qt.
Comment 11 Halla Rempt 2021-04-09 12:59:32 UTC
Git commit c152d1f49015e5799b1b1529457eda10bf3efb5e by Halla Rempt.
Committed on 09/04/2021 at 12:59.
Pushed by rempt into branch 'master'.

Fix warnings about deprecated behaviour of QByteRef

Make sure that the dst QByteArray is big enough and filled up with
known content before copying the rle'd src into it. Then when done
resize to the final size.

This prevents the following from being printed a gazillion times
when loading an image with a layerstyle that uses a pattern:

Using QByteRef with an index pointing outside the valid range of a QByteArray. The corresponding behavior is deprecated, and will be changed in a future version of Qt.

M  +5    -2    libs/psd/compression.cpp

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