Bug 427720

Summary: EXR files imported as file layers generate canvas-wide layers filled with black
Product: krita Reporter: Tonja
Component: File formatsAssignee: Dmitry Kazakov <dimula73>
Status: RESOLVED FIXED    
Severity: normal CC: ahab.greybeard, amy
Priority: NOR Keywords: regression
Version: 4.4.0   
Target Milestone: ---   
Platform: Other   
OS: Linux   
URL: https://invent.kde.org/graphics/krita/-/commit/82c5624804f9df6309f8548892c01afad3f62d5c
Latest Commit: Version Fixed In:
Attachments: Archive containing the issue demonstration file
picture showing what the issue looks like (with a test file using only the EXR external file)

Description Tonja 2020-10-14 20:50:14 UTC
Created attachment 132363 [details]
Archive containing the issue demonstration file

SUMMARY
When imported as File Layers, EXR files smaller than the picture itself will appear in the top-left corner, as usual, but since the 4.4.0 release, all empty space will be filled with black colour to match the size of the canvas, generating very large layers filled with unneeded information.

STEPS TO REPRODUCE
1. Unpack the FileLayerFillIssue.zip, which contains a .kra file and two small external files used as File Layer, pinkSquare.exr and pinkSquare.png.

2. Open the FileLayerFillIssue.kra file with Krita 4.3 ; the file layers are in the corner of the picture and background is still visible.

3. Open the FileLayerFillIssue.kra file with Krita 4.4 ; the file layers are in the corner of the picture, but background is not visible as the file layer referencing pinkSquare.exr filled all the canvas with opaque black. Layer thumbnail shows that this layer is now as large as the canvas itself ( Krita4_4FileLayerBehaviour.png shows a side-by-side comparison with the background using only the EXR file layer)

OBSERVED RESULT
File layer referencing the EXR external picture file introduced black opaque pixels in the empty space not covered by the picture file itself

EXPECTED RESULT
File layer referencing the EXR external picture file should left most of the picture empty, as does the file layer referencing the PNG external picture file

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

ADDITIONAL INFORMATION
Comment 1 Tonja 2020-10-14 20:51:24 UTC
Created attachment 132364 [details]
picture showing what the issue looks like (with a test file using only the EXR external file)
Comment 2 Ahab Greybeard 2020-10-15 09:32:05 UTC
I can confirm this with the files provided in the attachment when using the 4.4.0  and the Oct 14 4.4.1 alpha (git 2bcfb8b) appimages
It also happens for a totally transparent .exr file layer.

It does not happen with the 4.3.0 appimage.
Comment 3 amyspark 2020-10-26 15:42:29 UTC
Assigning to Dmitry as it's a regression caused by https://invent.kde.org/graphics/krita/-/commit/82c5624804f9df6309f8548892c01afad3f62d5c.
Comment 4 Dmitry Kazakov 2020-11-27 10:41:17 UTC
Git commit 3b7caf0eb8ef130aba7d83a4220c9ca30008e086 by Dmitry Kazakov.
Committed on 27/11/2020 at 10:40.
Pushed by dkazakov into branch 'krita/4.3'.

Disable automatic black background for EXR file

It creates troubles when the file is imported as a layer or
a file layer.

M  +5    -1    plugins/impex/exr/exr_converter.cc

https://invent.kde.org/graphics/krita/commit/3b7caf0eb8ef130aba7d83a4220c9ca30008e086
Comment 5 Dmitry Kazakov 2020-11-27 10:43:22 UTC
Git commit c1d7fcfd8dcb35f11f3fe666fce8a5eeaff37336 by Dmitry Kazakov.
Committed on 27/11/2020 at 10:43.
Pushed by dkazakov into branch 'master'.

Disable automatic black background for EXR file

It creates troubles when the file is imported as a layer or
a file layer.

M  +5    -1    plugins/impex/exr/exr_converter.cc

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