Skip to content

439817 MyPaint: accept brushes serialized as KPP and fix their names

MyPaint brushes have two issues at present:

  • serialization was never implemented, which means they depend on KisPaintOpPreset's specification -- a PNG file whose iTXT blob lists several properties of the preset.
  • deserialization assumes the .myb format; this means bundles saved via Krita's own bundle creation flow will store .kpp (PNG image) in .myb skin (as specified by the original file's extension), thus leading to a resource load failure each time the app opens.

This MR attempts to fix that by implementing deserialization of KPP-serialized MyPaint brushes through the superclass constructor, while also adjusting the preset filename to account for the change in format.

BUG: 439817

Test Plan

  1. Build Krita.
  2. Save some MyPaint presets to a bundle.
  3. Open the bundle via a ZIP file manager and:
  • check that its manifest lists the presets as .kpp files, NOT .myb, and that the corresponding files are present.
  • conversely, if the manifest lists .myb files, each of the file must be present and its content must be a JSON blob.
  1. Delete the presets, if applicable.
  2. Load the bundle, and check that all presets are available.

Formalities Checklist

  • I confirmed this builds.
  • I confirmed Krita ran and the relevant functions work.
  • I tested the relevant unit tests and can confirm they are not broken. (If not possible, don't hesitate to ask for help!)
  • I made sure my commits build individually and have good descriptions as per KDE guidelines.
  • I made sure my code conforms to the standards set in the HACKING file.
  • I can confirm the code is licensed and attributed appropriately, and that unattributed code is mine, as per KDE Licensing Policy.

Merge request reports