From e08cf9ec0bdcdbf6efb521a6d59bc3eb04c6cf92 Mon Sep 17 00:00:00 2001 From: Christoph Klaffl Date: Thu, 5 Mar 2026 19:53:37 +0100 Subject: [PATCH 1/3] Enable ZIP_DEFLATED compression for office files docx/xlsx/pptx by default use the DEFLATE compression. After removing the metadata dmeta saves the output as a zip file without any compression applied resulting in a bigger file than before (in my case a ~100 kb file increased to ~500kb after using dmeta). So let dmeta also use the DEFLATE compression for saving. --- dmeta/functions.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dmeta/functions.py b/dmeta/functions.py index d690ca9..3636b68 100644 --- a/dmeta/functions.py +++ b/dmeta/functions.py @@ -87,7 +87,7 @@ def is_metadata_cleared(xml_path, is_core=True): modified = microsoft_file_name if not in_place: modified = microsoft_file_name[:microsoft_file_name.rfind('.')] + "_cleared" + "." + microsoft_format - with zipfile.ZipFile(modified, "w") as file: + with zipfile.ZipFile(modified, "w", compression=zipfile.ZIP_DEFLATED) as file: for file_name in source_file.namelist(): file.write(os.path.join(unzipped_dir, file_name), file_name) file.close() @@ -191,7 +191,7 @@ def is_metadata_up_to_date(xml_path, metadata, is_core=True): modified = microsoft_file_name if not in_place: modified = microsoft_file_name[:microsoft_file_name.rfind('.')] + "_updated" + "." + microsoft_format - with zipfile.ZipFile(modified, "w") as file: + with zipfile.ZipFile(modified, "w", compression=zipfile.ZIP_DEFLATED) as file: for file_name in source_file.namelist(): file.write(os.path.join(unzipped_dir, file_name), file_name) file.close() From a7541d48f9fd20f1a933174c619f3fa1aaec0a46 Mon Sep 17 00:00:00 2001 From: Christoph Klaffl Date: Mon, 13 Apr 2026 11:02:23 +0200 Subject: [PATCH 2/3] document changes --- CHANGELOG.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 32dd818..b05ad4b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -79,6 +79,9 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. - `read_json` function in `util.py` [Unreleased]: https://github.com/openscilab/dmeta/compare/v0.4...dev +### Changed +- `clear` function in `functions.py` +- `update` function in `functions.py` [0.4]: https://github.com/openscilab/dmeta/compare/v0.3...v0.4 [0.3]: https://github.com/openscilab/dmeta/compare/v0.2...v0.3 [0.2]: https://github.com/openscilab/dmeta/compare/v0.1...v0.2 From 95b1f36ee6e6bfdc4ec44c7938919a7951e63794 Mon Sep 17 00:00:00 2001 From: AmirHosein Rostami Date: Mon, 13 Apr 2026 11:35:15 -0400 Subject: [PATCH 3/3] Update CHANGELOG --- CHANGELOG.md | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b05ad4b..a387cac 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,15 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html). +## [Unreleased] +### Added +- `clear_png_metadata` function in `functions.py` +- `extract_metadata` function in `functions.py` +### Changed +- `clear` function in `functions.py` +- `update` function in `functions.py` +- Test system modified +- `README.md` updated ## [0.4] - 2025-06-16 ### Added - `Acknowledgments` in `README.md` @@ -79,9 +88,6 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. - `read_json` function in `util.py` [Unreleased]: https://github.com/openscilab/dmeta/compare/v0.4...dev -### Changed -- `clear` function in `functions.py` -- `update` function in `functions.py` [0.4]: https://github.com/openscilab/dmeta/compare/v0.3...v0.4 [0.3]: https://github.com/openscilab/dmeta/compare/v0.2...v0.3 [0.2]: https://github.com/openscilab/dmeta/compare/v0.1...v0.2