Bug 364047 - When saving PSD files, layer boundaries get messed up
Summary: When saving PSD files, layer boundaries get messed up
Status: RESOLVED FIXED
Alias: None
Product: krita
Classification: Applications
Component: File formats (show other bugs)
Version: 3.0
Platform: Other Other
: NOR normal
Target Milestone: ---
Assignee: Krita Bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-06-07 07:26 UTC by Krešimir Špes
Modified: 2016-06-13 08:25 UTC (History)
2 users (show)

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


Attachments
visible boundary problem in GIMP (32.42 KB, image/jpeg)
2016-06-07 07:27 UTC, Krešimir Špes
Details
example of how it should be, taken from photoshop (18.00 KB, image/jpeg)
2016-06-07 07:29 UTC, Krešimir Špes
Details
test file in Krita format (65.87 KB, application/x-krita)
2016-06-07 07:29 UTC, Krešimir Špes
Details
test file in PSD format (81.62 KB, image/vnd.adobe.photoshop)
2016-06-07 07:29 UTC, Krešimir Špes
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Krešimir Špes 2016-06-07 07:26:57 UTC
When saving a PSD file in krita, the layer boundaries are wrong. When opening this file with GIMP or python psd-tools, I get wrong layer boundary information.

When opening with Photoshop there's no problem because photoshop auto crops the layer boundary to the visible pixels. We rely on the boundary info to export art from psd files which prevents use from using krita.

The bug can be easily reproduced, just save a layered psd in Krita and open it in gimp, any version of gimp. You'll see the layer bondaries are wrong. If you perform an "Autocrop layer" operation in Gimp, you can see the boundaries snap to where they're supposed to be.

Reproducible in any OS. We tried in Windows and Mac

Reproducible: Always

Steps to Reproduce:
1. Save PSD file in Krita
2. Open in GIMP
3. Observe shock on own face :)

Actual Results:  
Layer boundaries are not cropped

Expected Results:  
Layer boundaries (x, y, w, h) should be cropped to the visible pixels in the psd file, the way photoshop does it.

repro files can be found here: https://www.dropbox.com/s/s6kxs8hsp5wr0s9/krita_bug.zip?dl=0
Comment 1 Krešimir Špes 2016-06-07 07:27:58 UTC
Created attachment 99394 [details]
visible boundary problem in GIMP
Comment 2 Krešimir Špes 2016-06-07 07:29:10 UTC
Created attachment 99395 [details]
example of how it should be, taken from photoshop
Comment 3 Krešimir Špes 2016-06-07 07:29:29 UTC
Created attachment 99396 [details]
test file in Krita format
Comment 4 Krešimir Špes 2016-06-07 07:29:45 UTC
Created attachment 99397 [details]
test file in PSD format
Comment 5 Halla Rempt 2016-06-13 08:25:43 UTC
Git commit eb0d266b93023eae37b9891c72b25d4399d415e7 by Boudewijn Rempt.
Committed on 13/06/2016 at 08:24.
Pushed by rempt into branch 'krita/3.0'.

Otherwise they will grow in steps of 64x64 pixels. Interestingly,
photoshop crops all transparent pixels when loading, while Gimp
doesn't do that.

M  +1    -1    plugins/impex/psd/psd_layer_section.cpp

http://commits.kde.org/krita/eb0d266b93023eae37b9891c72b25d4399d415e7