| Summary: | TIFF image file size increases after each overwrite | ||
|---|---|---|---|
| Product: | [Applications] krita | Reporter: | AgitatoArt <AgitatoArtworks> |
| Component: | File formats | Assignee: | Krita Bugs <krita-bugs-null> |
| Status: | RESOLVED FIXED | ||
| Severity: | normal | CC: | antonmx, griffinvalley |
| Priority: | NOR | ||
| Version First Reported In: | 5.2.9 | ||
| Target Milestone: | --- | ||
| Platform: | Mint (Ubuntu based) | ||
| OS: | Linux | ||
| Latest Commit: | https://invent.kde.org/graphics/krita/-/commit/b4753f9d311814388f35177ea683e7ed7d72b165 | Version Fixed/Implemented In: | |
| Sentry Crash Report: | |||
|
Description
AgitatoArt
2025-02-28 20:24:39 UTC
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 |