Bug 424977 - Command Line Export file parse errors
Summary: Command Line Export file parse errors
Status: RESOLVED FIXED
Alias: None
Product: krita
Classification: Applications
Component: General (show other bugs)
Version: 4.3.0
Platform: Manjaro Linux
: NOR major
Target Milestone: ---
Assignee: Krita Bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-08-03 22:01 UTC by james.schuepbach
Modified: 2021-09-07 09:47 UTC (History)
5 users (show)

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


Attachments
Test file: "la" + "color" group layers (289.67 KB, application/zip)
2020-12-13 23:10 UTC, Tiar
Details
Test file: Original file scaled down to 1x1 pixel and removed all reference images (contains all groups) (565.11 KB, application/zip)
2020-12-13 23:17 UTC, Tiar
Details
File causing Krita's command line export to fail sometimes (191.19 KB, application/x-krita)
2021-05-15 08:38 UTC, satcom886
Details

Note You need to log in before you can comment on or make changes to this bug.
Description james.schuepbach 2020-08-03 22:01:34 UTC
SUMMARY
about 50% of the krita files i cannot export over the command line tool. with the export ui in krita I can export every file without any error. (command line is necessary because I want create pdfs with a build pipeline)

STEPS TO REPRODUCE
1. Export Png File with file -> export then the png file exports sucessfully
2. export png with command line arguments (krita export-file.kra --export --export-filename test.png


OBSERVED RESULT
result:
krita.lib.widgets: The file could not be parsed.
krita.general: Could not export  "/home/user/export-file.kra" to "test.png" : ""
krita.general: Warning: some tiles have leaked:
krita.general:  Tiles in memory: 65699 
        Total tiles: 66123

EXPECTED RESULT
same export result as the gui export

my sample file is over 100mb what is the current practise to host such a big file?



Linux Manjaro, current version
KDE Plasma Version: no plasma, custom i3 build
KDE Frameworks Version: (5.72.0)
Qt Version: 5.15.0 (built against 5.15.0)

ADDITIONAL INFORMATION
Comment 1 Tiar 2020-08-04 01:44:18 UTC
Could you please try to use the crop tool to crop the file to some reasonable size? Then please make sure you have the issue with this file as well, and then attach it here.
If cropping creates a file that doesn't have the issue, try scaling down.
Without the image it might be difficult to figure out what's wrong...
Comment 2 james.schuepbach 2020-08-04 21:49:12 UTC
Thank you very much for your fast response!

I scaled the kra file down to 50 px and the error still occurs. 
But the file is still bigger than 4000kb so I uploaded it to my google drive share

https://drive.google.com/drive/folders/1p5ut7uIhVaYdidg_DIjjdYq2YlCJlNHa
Comment 3 james.schuepbach 2020-08-04 21:49:45 UTC
(In reply to Tymond from comment #1)
> Could you please try to use the crop tool to crop the file to some
> reasonable size? Then please make sure you have the issue with this file as
> well, and then attach it here.
> If cropping creates a file that doesn't have the issue, try scaling down.
> Without the image it might be difficult to figure out what's wrong...

see comment below
Comment 4 Bug Janitor Service 2020-08-05 04:33:17 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 5 Tiar 2020-12-13 23:10:07 UTC
Created attachment 134062 [details]
Test file: "la" + "color" group layers

This is actually a regression between 4.2.7 and 4.2.8, and I attached a smaller version of the file mentioned above. Note that it contains two group layers. If you remove any of them, it will work again.
Comment 6 Tiar 2020-12-13 23:17:53 UTC
Created attachment 134063 [details]
Test file: Original file scaled down to 1x1 pixel and removed all reference images (contains all groups)

Note that this file has multiple group layers. If you remove "color" group layer, it will work. If you leave only "color" group layer, it will work as well. So it's neither "multiple group layers = bad" nor "color group = bad".

Note that "color" group layer includes local selection.

In the original file there were reference images, but they don't affect the result.

This is probably related to the changes in saving between those versions. Also note that the "Leaking tiles" is visible in all cases since 4.0.4.
Comment 7 bobbens 2021-01-16 11:31:33 UTC
I just would like to mention I get the same issue on arch linux. However, it doesn't always necessarily fail. Sometimes it does succeed in exporting, and the resulting image works fine. Furthermore, instead of having the "Could not export" message, sometimes Krita segmentation faults. Backtrace is as follows.

#0  0x00007ffff5fddb06 in KisUpdateTimeMonitor::reportUpdateFinished(QRect const&) () at /usr/lib/libkritaimage.so.20
#1  0x00007ffff5fe7810 in KisImage::notifyProjectionUpdated(QRect const&) () at /usr/lib/libkritaimage.so.20
#2  0x00007ffff5ec23de in  () at /usr/lib/libkritaimage.so.20
#3  0x00007ffff4963302 in  () at /usr/lib/libQt5Core.so.5
#4  0x00007ffff495ff0f in  () at /usr/lib/libQt5Core.so.5
#5  0x00007ffff29563e9 in start_thread () at /usr/lib/libpthread.so.0
#6  0x00007ffff45d2293 in clone () at /usr/lib/libc.so.6
Comment 8 satcom886 2021-05-15 08:38:56 UTC
Created attachment 138446 [details]
File causing Krita's command line export to fail sometimes

(In reply to bobbens from comment #7)
> I just would like to mention I get the same issue on arch linux. However, it
> doesn't always necessarily fail. Sometimes it does succeed in exporting, and
> the resulting image works fine. Furthermore, instead of having the "Could
> not export" message, sometimes Krita segmentation faults. Backtrace is as
> follows.
> 
> #0  0x00007ffff5fddb06 in KisUpdateTimeMonitor::reportUpdateFinished(QRect
> const&) () at /usr/lib/libkritaimage.so.20
> #1  0x00007ffff5fe7810 in KisImage::notifyProjectionUpdated(QRect const&) ()
> at /usr/lib/libkritaimage.so.20
> #2  0x00007ffff5ec23de in  () at /usr/lib/libkritaimage.so.20
> #3  0x00007ffff4963302 in  () at /usr/lib/libQt5Core.so.5
> #4  0x00007ffff495ff0f in  () at /usr/lib/libQt5Core.so.5
> #5  0x00007ffff29563e9 in start_thread () at /usr/lib/libpthread.so.0
> #6  0x00007ffff45d2293 in clone () at /usr/lib/libc.so.6

Hi, I'm also on Arch with Krita 4.4.3 and I seem to have the same problem that you described. I never managed to get it to segfault tho.


This is Krita's output when it succeeds:
Invalid profile :  "/usr/share/color/icc/colord/Crayons.icc" "Crayon Colors"
Invalid profile :  "/usr/share/color/icc/colord/x11-colors.icc" "X11 Colors"
Loading plugin "/usr/lib/kritaplugins/kritaseexprgenerator.so" failed,  "Cannot load library /usr/lib/kritaplugins/kritaseexprgenerator.so: (libKSeExprUI.so.4.0.1.0: cannot open shared object file: No such file or directory)"
Loading plugin "/usr/lib/kritaplugins/kritalutdocker.so" failed,  "Cannot load library /usr/lib/kritaplugins/kritalutdocker.so: (libOpenColorIO.so.1: cannot open shared object file: No such file or directory)"
qt.gui.icc: fromIccProfile: Invalid ICC profile - invalid white-point
QPngHandler: Failed to parse ICC profile
qt.gui.icc: fromIccProfile: Invalid ICC profile - invalid white-point
QPngHandler: Failed to parse ICC profile
qt.gui.icc: fromIccProfile: Invalid ICC profile - invalid white-point
QPngHandler: Failed to parse ICC profile
qt.gui.icc: fromIccProfile: Invalid ICC profile - invalid white-point
QPngHandler: Failed to parse ICC profile
qt.gui.icc: fromIccProfile: Invalid ICC profile - invalid white-point
QPngHandler: Failed to parse ICC profile
qt.gui.icc: fromIccProfile: Invalid ICC profile - invalid white-point
QPngHandler: Failed to parse ICC profile
krita.general: Warning: some tiles have leaked:
krita.general:  Tiles in memory: 242 
        Total tiles: 242

This is when it fails:
Invalid profile :  "/usr/share/color/icc/colord/Crayons.icc" "Crayon Colors"
Invalid profile :  "/usr/share/color/icc/colord/x11-colors.icc" "X11 Colors"
Loading plugin "/usr/lib/kritaplugins/kritaseexprgenerator.so" failed,  "Cannot load library /usr/lib/kritaplugins/kritaseexprgenerator.so: (libKSeExprUI.so.4.0.1.0: cannot open shared object file: No such file or directory)"
Loading plugin "/usr/lib/kritaplugins/kritalutdocker.so" failed,  "Cannot load library /usr/lib/kritaplugins/kritalutdocker.so: (libOpenColorIO.so.1: cannot open shared object file: No such file or directory)"
qt.gui.icc: fromIccProfile: Invalid ICC profile - invalid white-point
QPngHandler: Failed to parse ICC profile
qt.gui.icc: fromIccProfile: Invalid ICC profile - invalid white-point
QPngHandler: Failed to parse ICC profile
qt.gui.icc: fromIccProfile: Invalid ICC profile - invalid white-point
QPngHandler: Failed to parse ICC profile
qt.gui.icc: fromIccProfile: Invalid ICC profile - invalid white-point
QPngHandler: Failed to parse ICC profile
qt.gui.icc: fromIccProfile: Invalid ICC profile - invalid white-point
QPngHandler: Failed to parse ICC profile
qt.gui.icc: fromIccProfile: Invalid ICC profile - invalid white-point
QPngHandler: Failed to parse ICC profile
krita.general: Could not export  "/home/satcom886/Documents/CoolGame1/images_src/lamp.kra" to "lamp.png" : ""
krita.general: Warning: some tiles have leaked:
krita.general:  Tiles in memory: 242 
        Total tiles: 242
Comment 9 Halla Rempt 2021-05-15 09:40:15 UTC
That is completely unrelated and a build issue on your arch system: for some reason the lutdocker and the kseexpr plugin aren't rebuilt, and now it's too old:

Loading plugin "/usr/lib/kritaplugins/kritaseexprgenerator.so" failed,  "Cannot load library /usr/lib/kritaplugins/kritaseexprgenerator.so: (libKSeExprUI.so.4.0.1.0: cannot open shared object file: No such file or directory)"
Loading plugin "/usr/lib/kritaplugins/kritalutdocker.so" failed,  "Cannot load library /usr/lib/kritaplugins/kritalutdocker.so: (libOpenColorIO.so.1: cannot open shared object file: No such file or directory)"

Probably because some dependency broke. Not a bug in Krita, but a feature of Arch Linux.
Comment 10 satcom886 2021-05-15 14:30:25 UTC
(In reply to Halla Rempt from comment #9)
> That is completely unrelated and a build issue on your arch system: for some
> reason the lutdocker and the kseexpr plugin aren't rebuilt, and now it's too
> old:
> 
> Loading plugin "/usr/lib/kritaplugins/kritaseexprgenerator.so" failed, 
> "Cannot load library /usr/lib/kritaplugins/kritaseexprgenerator.so:
> (libKSeExprUI.so.4.0.1.0: cannot open shared object file: No such file or
> directory)"
> Loading plugin "/usr/lib/kritaplugins/kritalutdocker.so" failed,  "Cannot
> load library /usr/lib/kritaplugins/kritalutdocker.so: (libOpenColorIO.so.1:
> cannot open shared object file: No such file or directory)"
> 
> Probably because some dependency broke. Not a bug in Krita, but a feature of
> Arch Linux.

Thanks for the reply, I'll report it on the Arch bug tracker. But are you certain that these modules are responsible for the export failure? As I said, sometimes it exports successfully and when it does, these errors are still present...
Comment 11 Halla Rempt 2021-09-07 09:47:53 UTC
Fixed in d1a1874d77681ca94ecf88494893510c286ebed2