Bug 452502 - Krita refuses to open valid files based on extension
Summary: Krita refuses to open valid files based on extension
Status: RESOLVED UPSTREAM
Alias: None
Product: krita
Classification: Applications
Component: File formats (show other bugs)
Version: 5.0.2
Platform: Arch Linux Linux
: NOR normal
Target Milestone: ---
Assignee: Krita Bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-04-11 14:09 UTC by Storm Engineer
Modified: 2022-04-11 14:13 UTC (History)
1 user (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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.