Skip to content

416506 Convert tga to 24bit if there is no alpha data

Ivan Yossi requested to merge ivany/krita:416506_onlyAlpha into master

Some targa 24bit images are saved as 32bit for load efficiency. There is no specification to signal this in the header so we have to check there is indeed some data in 32bit alpha channel to avoid opening the image as full alpha.

BUG:416506

The "Some 24bit targa are saved as 32bit" is taken from http://www.paulbourke.net/dataformats/tga/

Test Plan

I test open all tga files from: TGA sequences: https://blogs.unity3d.com/2016/11/28/free-vfx-image-sequences-flipbooks/ TGA diff bitdepth: http://netghost.narod.ru/gff/sample/images/tga/index.htm https://www.fileformat.info/format/tga/sample/index.htm

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