Skip to content

Bugfix: Make TIFF import and export work on Android

Sharaf Zaman requested to merge szaman/krita:bug-fix-tiff-android into master

Prior to this we passed the filename to the libtiff and expect it to open it. But this failed on Android, now we open the file using QFile (since it supports content URI). And pass the file descriptor to libtiff.

We again used filename for reading/writing exif data and since libexiv2 doesn't support using file descriptors, I created a new IO backend which is a wrapper around QFile. This was required since tiff file can be too big to be put in the memory (had we used ioDevice->readAll()).

I believe the location of KisExiv2IODevice.cpp/h is less than ideal. But since the kritaexif module is linked as a MODULE, it created some complications when getting to link it with kritatiffimport/export. I'm unsure if we should make kritaexif a SHARED library? Any ideas about this?

Test Plan

Open TIFF file with metadata, check if the file opens and metadata is listed like it did before.

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