Bug 464015 - Psd files don't load layers correctly
Summary: Psd files don't load layers correctly
Status: RESOLVED FIXED
Alias: None
Product: krita
Classification: Applications
Component: File formats (show other bugs)
Version: 5.1.5
Platform: Android Android 13.x
: NOR major
Target Milestone: ---
Assignee: amyspark
URL:
Keywords:
: 464418 465013 472900 473133 (view as bug list)
Depends on:
Blocks:
 
Reported: 2023-01-08 19:22 UTC by Simone
Modified: 2023-09-04 07:10 UTC (History)
7 users (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments
Bug layers (83.02 KB, image/jpeg)
2023-01-08 19:22 UTC, Simone
Details
Screenshot (585.88 KB, image/jpeg)
2023-01-09 17:46 UTC, Simone
Details
Psd (3.56 MB, image/x-photoshop)
2023-01-09 17:47 UTC, Simone
Details
Krita (1.27 MB, application/x-krita)
2023-01-09 17:47 UTC, Simone
Details
New file (866.71 KB, image/jpeg)
2023-01-09 17:56 UTC, Simone
Details
New file 2 (750.38 KB, image/jpeg)
2023-01-09 17:57 UTC, Simone
Details
Draw and save file (877.91 KB, image/jpeg)
2023-01-09 17:57 UTC, Simone
Details
Saving (324.20 KB, image/jpeg)
2023-01-09 17:58 UTC, Simone
Details
Closed file (615.76 KB, image/jpeg)
2023-01-09 17:58 UTC, Simone
Details
Reopen file (741.94 KB, image/jpeg)
2023-01-09 17:59 UTC, Simone
Details
Open a previously saved file with lots of layers (499.48 KB, image/jpeg)
2023-01-09 17:59 UTC, Simone
Details
All layers are grey in preview and white on canvas (697.87 KB, image/jpeg)
2023-01-09 18:00 UTC, Simone
Details
Test file created with Krita (2.26 MB, image/x-photoshop)
2023-01-10 22:46 UTC, Simone
Details
Test file opened and saved in Csp (2.60 MB, image/x-photoshop)
2023-01-10 22:47 UTC, Simone
Details
1 draw in Krita, save file as psd, no file name (551.31 KB, image/jpeg)
2023-01-10 22:48 UTC, Simone
Details
2 file name and preview available in recent files (452.00 KB, image/jpeg)
2023-01-10 22:49 UTC, Simone
Details
3 open and draw in csp and save (465.73 KB, image/jpeg)
2023-01-10 22:49 UTC, Simone
Details
4 open file in Krita, canvas is white (633.95 KB, image/jpeg)
2023-01-10 22:50 UTC, Simone
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Simone 2023-01-08 19:22:59 UTC
Created attachment 155119 [details]
Bug layers

SUMMARY
***
NOTE: If you are reporting a crash, please try to attach a backtrace with debug symbols.
See https://community.kde.org/Guidelines_and_HOWTOs/Debugging/How_to_create_useful_crash_reports
***


STEPS TO REPRODUCE
1. Create new picture
2. Create painting layers and draw
3. Save as psd file
4. Close the file and/or Krita
5. Open psd file or any psd file which was saved before

OBSERVED RESULT
All layers are white or show slim red/blue/green or grey lines
Layers don't show content

EXPECTED RESULT
Layers show content of what was previously drawn

SOFTWARE/OS VERSIONS
Windows: 
macOS: 
Linux/KDE Plasma: 
(available in About System)
KDE Plasma Version: 
KDE Frameworks Version: 
Qt Version: 

ADDITIONAL INFORMATION
Comment 1 amyspark 2023-01-08 21:22:46 UTC
Hi! I'll assign this bug to myself.

In the meanwhile, could you please send a small test case to help reproduce the bug? Both KRA and the exported PSD.
Comment 2 Simone 2023-01-09 17:46:58 UTC
Created attachment 155142 [details]
Screenshot
Comment 3 Simone 2023-01-09 17:47:31 UTC
Created attachment 155143 [details]
Psd
Comment 4 Simone 2023-01-09 17:47:52 UTC
Created attachment 155144 [details]
Krita
Comment 5 Simone 2023-01-09 17:54:15 UTC
Hi, this may have happened after the update to 5.1.5. I have created psd files before the update and they were fine. Apparently, after the update none of my files show correctly.

1. File>New>Create
2. Draw on paint layer
3. File>Save as>Psd
4. Close file
5. Open file either via recent files  or File>Open
6. Paint layer is white
Comment 6 Simone 2023-01-09 17:56:57 UTC
Created attachment 155145 [details]
New file
Comment 7 Simone 2023-01-09 17:57:26 UTC
Created attachment 155146 [details]
New file 2
Comment 8 Simone 2023-01-09 17:57:54 UTC
Created attachment 155147 [details]
Draw and save file
Comment 9 Simone 2023-01-09 17:58:13 UTC
Created attachment 155148 [details]
Saving
Comment 10 Simone 2023-01-09 17:58:42 UTC
Created attachment 155149 [details]
Closed file
Comment 11 Simone 2023-01-09 17:59:08 UTC
Created attachment 155150 [details]
Reopen file
Comment 12 Simone 2023-01-09 17:59:52 UTC
Created attachment 155151 [details]
Open a previously saved file with lots of layers
Comment 13 Simone 2023-01-09 18:00:30 UTC
Created attachment 155152 [details]
All layers are grey in preview and white on canvas
Comment 14 Simone 2023-01-10 16:22:03 UTC
I just uninstalled Krita and installed again. It's the same issue. Not sure whether it's important but on the Google Store it says "Krita (Early Access)".
Comment 15 amyspark 2023-01-10 19:56:25 UTC
I'll start working on this later today.
Comment 16 amyspark 2023-01-10 21:12:04 UTC
I cannot reproduce with desktop 5.15, used 8-bit RGBA for the export and then opened the file back into Krita.

If you have a file that renders like that after export, please let us know by attaching it to this bug.
Comment 17 Simone 2023-01-10 22:44:24 UTC
Hi, I installed Krita for desktop and my old files look normal. The issue is with Krita on my Samsung Galaxy tablet S8 Ultra, SM-X900.

I tried an experiment: 

1. Save a file in Krita as psd (I noticed that after saving, the file name does not show in the header, even though it shows correctly in the recent files)
2. Open file in Clip Studio Paint and draw, save it as psd
3. Open the file in Krita

Please check the attached files, it's all white after opening in Krita.
Comment 18 Simone 2023-01-10 22:46:39 UTC
Created attachment 155194 [details]
Test file created with Krita
Comment 19 Simone 2023-01-10 22:47:20 UTC
Created attachment 155195 [details]
Test file opened and saved in Csp
Comment 20 Simone 2023-01-10 22:48:25 UTC
Created attachment 155196 [details]
1 draw in Krita, save file as psd, no file name
Comment 21 Simone 2023-01-10 22:49:05 UTC
Created attachment 155197 [details]
2 file name and preview available in recent files
Comment 22 Simone 2023-01-10 22:49:42 UTC
Created attachment 155198 [details]
3 open and draw in csp and save
Comment 23 Simone 2023-01-10 22:50:18 UTC
Created attachment 155199 [details]
4 open file in Krita, canvas is white
Comment 24 Bug Janitor Service 2023-01-11 05:19:54 UTC
Thanks for your comment!

Automatically switching the status of this bug to REPORTED so that the KDE team
knows that the bug is ready to get confirmed.

In the future you may also do this yourself when providing needed information.
Comment 25 sh_zam 2023-01-13 18:08:25 UTC
Given https://invent.kde.org/graphics/krita/-/commit/0f826dd72121d873450f9e2b72e6df82c04169ea is the only commit which touched PSD in 5.1.5, I think this happens because char type is unsigned on ARM and PackBits requires header to be signed here: https://invent.kde.org/graphics/krita/-/commit/0f826dd72121d873450f9e2b72e6df82c04169ea#7416fb520207f8cced3ae09d6d206dc234b55b83_120_96
Comment 26 amyspark 2023-01-14 12:27:28 UTC
(In reply to sh_zam from comment #25)
> char type is unsigned on ARM and
> PackBits requires header to be signed here:

EEK. Assigning to myself, incoming fix now.
Comment 27 amyspark 2023-01-14 12:29:46 UTC
Git commit 0abf00babfa80689521a67fcdb4527fc980d25f7 by L. E. Segovia.
Committed on 14/01/2023 at 12:29.
Pushed by lsegovia into branch 'master'.

PSD: fix using implementation-defined signedness when decompressing RLE

M  +3    -2    libs/psdutils/compression.cpp

https://invent.kde.org/graphics/krita/commit/0abf00babfa80689521a67fcdb4527fc980d25f7
Comment 28 amyspark 2023-01-14 12:30:04 UTC
Git commit 4e69b49f8bbfc8feebf727e6410018521d12c040 by L. E. Segovia.
Committed on 14/01/2023 at 12:29.
Pushed by lsegovia into branch 'krita/5.1'.

PSD: fix using implementation-defined signedness when decompressing RLE
(cherry picked from commit 0abf00babfa80689521a67fcdb4527fc980d25f7)

M  +3    -2    libs/psdutils/compression.cpp

https://invent.kde.org/graphics/krita/commit/4e69b49f8bbfc8feebf727e6410018521d12c040
Comment 29 wolthera 2023-01-17 18:57:07 UTC
*** Bug 464418 has been marked as a duplicate of this bug. ***
Comment 30 amyspark 2023-01-29 22:44:17 UTC
*** Bug 465013 has been marked as a duplicate of this bug. ***
Comment 31 Freya Lupen 2023-08-20 13:17:47 UTC
*** Bug 473133 has been marked as a duplicate of this bug. ***
Comment 32 sh_zam 2023-09-04 07:10:23 UTC
*** Bug 472900 has been marked as a duplicate of this bug. ***