Bug 452502

Summary: Krita refuses to open valid files based on extension
Product: [Applications] krita Reporter: Storm Engineer <storm.anthro>
Component: File formatsAssignee: Krita Bugs <krita-bugs-null>
Status: RESOLVED UPSTREAM    
Severity: normal CC: halla
Priority: NOR    
Version First Reported In: 5.0.2   
Target Milestone: ---   
Platform: Arch Linux   
OS: Linux   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:

Description Storm Engineer 2022-04-11 14:09:45 UTC
SUMMARY
I have tried to open one of the save backup files created by Krita, with the ".kra.1~" extension, only to be told Krita can't open it because it's not the right file type. After being renamed to ".kra" it opened without a problem.

Krita, especially on Linux, should use file headers instead of extensions to determine if something is of a supported file type. This used to work previously.


STEPS TO REPRODUCE
1. Change a valid .kra file's extension to something invalid.
2. Try to open it.

OBSERVED RESULT
Krita will claim it's the wrong file type.

EXPECTED RESULT
Krita should open the file like it used to.

SOFTWARE/OS VERSIONS
Krita

 Version: 5.0.2
 Languages: en_US, en, en_US, en, hu_HU, hu
 Hidpi: false

Qt

  Version (compiled): 5.15.2
  Version (loaded): 5.15.3

OS Information

  Build ABI: x86_64-little_endian-lp64
  Build CPU: x86_64
  CPU: x86_64
  Kernel Type: linux
  Kernel Version: 5.17.1-arch1-1
  Pretty Productname: Arch Linux
  Product Type: arch
  Product Version: unknown
  Desktop: KDE

OpenGL Info
 
  Vendor:  "NVIDIA Corporation" 
  Renderer:  "NVIDIA GeForce GTX 750 Ti/PCIe/SSE2" 
  Version:  "4.6.0 NVIDIA 510.60.02" 
  Shading language:  "4.60 NVIDIA"
Comment 1 Halla Rempt 2022-04-11 14:13:45 UTC
The problem is with the shared-mime-info database which doesn't recognize all Krita files anymore because of a change in zip library. I've actually sent a patch upstream already.