SUMMARY Each time a .tif file is overwritten, it bloats in size significantly. My most recently saved file bloated from 16.7 MB to over 100 MB after a few overwrites with minimal changes. STEPS TO REPRODUCE 1. Export a TIFF image 2. Overwrite the same TIFF image via advanced export 3. Repeat step 2; the file size should increase with each overwrite OBSERVED RESULT The .tif file increases in size with each overwrite EXPECTED RESULT The .tif file should remain the same size with each overwrite
I can confirm. And indeed, inspecting with a hex editor confirms my suspicion the data is appended onto the old version.
*** Bug 502303 has been marked as a duplicate of this bug. ***
Git commit 20ca858c2d9130b5a46fdf6af1a3290630bb4497 by Dmitry Kazakov, on behalf of Igor Danilets. Committed on 21/05/2025 at 15:27. Pushed by dkazakov into branch 'master'. Fix TIFF file size bloating after each overwrite Unlike the stdio library TIFF image files may not be opened for both reading and writing; there is no support for altering the contents of a TIFF file. (https://libtiff.gitlab.io/libtiff/libtiff.html#basic-file-handling) However, function TIFFFdOpen do not truncate the TIFF file before the owerrite. When libtiff writes new data to existing file, the old data is not deleted. Solution: Truncate the TIFF file before calling the function TIFFFdOpen. M +1 -1 plugins/impex/tiff/kis_tiff_export.cc https://invent.kde.org/graphics/krita/-/commit/20ca858c2d9130b5a46fdf6af1a3290630bb4497
Git commit b4753f9d311814388f35177ea683e7ed7d72b165 by Dmitry Kazakov. Committed on 21/05/2025 at 15:29. Pushed by dkazakov into branch 'krita/5.2'. Fix TIFF file size bloating after each overwrite Unlike the stdio library TIFF image files may not be opened for both reading and writing; there is no support for altering the contents of a TIFF file. (https://libtiff.gitlab.io/libtiff/libtiff.html#basic-file-handling) However, function TIFFFdOpen do not truncate the TIFF file before the owerrite. When libtiff writes new data to existing file, the old data is not deleted. Solution: Truncate the TIFF file before calling the function TIFFFdOpen. (cherry picked from commit 20ca858c2d9130b5a46fdf6af1a3290630bb4497) Co-authored-by: Igor Danilets <danilec.igor@gmail.com> M +1 -1 plugins/impex/tiff/kis_tiff_export.cc https://invent.kde.org/graphics/krita/-/commit/b4753f9d311814388f35177ea683e7ed7d72b165