Skip to content

Latest commit

 

History

History
162 lines (110 loc) · 6.97 KB

File metadata and controls

162 lines (110 loc) · 6.97 KB

Changelog

This project follows Semantic Versioning.

1.6.3 - 2026-03-05

Fixed

  • Duplicate PDF files in batch mode: On Windows, case-insensitive glob caused *.pdf and *.PDF to match the same files, resulting in duplicate processing; now deduplicated via set union

1.6.2 - 2026-03-05

Changed

  • i18n: Default CLI output now in English for internationalization; use --cht flag for Traditional Chinese messages
  • i18n module: New ebook_crop/i18n.py with EN/CHT message dictionaries and t() translation function

1.6.1 - 2026-03-05

Added

  • Auto-margin result display: Show per-file detection summary (crop count, margin ranges) after processing; per-page details available with -v

1.6.0 - 2026-03-05

Added

  • Auto-detect margins: [auto_margins] enabled = true auto-detects content boundaries per page via PyMuPDF text/drawing/image extraction; [margins] ignored when enabled
  • Offset fine-tuning: [auto_margins] left/right/top/bottom offset values for post-detection adjustment
  • automargin.py: New module for content boundary detection and auto-crop
  • Auto-margin tests: 16 tests in test_automargin.py, total tests now 124

1.5.1 - 2026-03-05

Fixed

  • Test directory: Moved test data from test/input/ to tests/input/ and test/output/ to tests/output/ for consistency with pytest convention

1.5.0 - 2026-03-05

Added

  • pytest framework: Full test suite with 108 tests across 5 test modules
  • Config unit tests: Tests for parse_rotation_list, format_rotation_display, format_margins_display, load_config, convert_margin_value, validate_config (53 tests)
  • Rotation unit tests: Tests for _get_rotated_page_rect, dimension swap, build_pdf_with_rotation (15 tests)
  • Crop unit tests: Tests for _apply_crop boundary conditions, crop_pdf (11 tests)
  • Integration tests: End-to-end workflows and CLI integration (--version, --help, --dry-run, -v, -q) (12 tests)
  • Edge case tests: Single page, small page, landscape, large files (50 pages), rotation edge cases (17 tests)
  • CI test pipeline: pytest added to CI on Python 3.10/3.11/3.12 with coverage
  • Code coverage: pytest-cov integrated, coverage reporting in CI (config 97%, crop 98%, rotation 100%)
  • Sample PDFs and test configs: tests/input/ with basic_5page.pdf, single_page.pdf, ten_pages.pdf, landscape.pdf, small_page.pdf, and test TOML configs

Changed

  • CI workflow: Now includes pytest with coverage on Python 3.10/3.11/3.12

1.4.0 - 2026-03-05

Added

  • --version flag: Display current version (ebook_crop.__version__)
  • Progress bar: Rich progress bar during batch processing
  • Verbose/quiet mode: -v/--verbose for detailed logs, -q/--quiet for silent mode
  • Dry-run mode: --dry-run to preview settings and affected pages without processing
  • Margin unit support: Config accepts cm, mm, in/inch, pt suffixes (e.g. "1cm", "10mm", "0.5in", "36pt") in addition to plain numbers
  • Config validation: Validates config values on load with clear error messages for invalid margins, page ranges
  • Colored terminal output: Warnings in yellow, errors in red, success in green (via rich)
  • console.py module: Terminal output module handling colored output, progress bar, and verbosity control

Changed

  • CLI output: Now uses rich for colored formatting

1.3.0 - 2026-03-05

Added

  • Feature roadmap: docs/ROADMAP.md and docs-cht/ROADMAP.md with phased development plans covering testing, UX, core features, advanced features, and ecosystem
  • CLAUDE.md: Claude Code guidance file for AI-assisted development

Changed

  • Technical docs: Updated extension suggestions (section 6) to reference ROADMAP, added file list entries for new docs
  • Documentation index: Added ROADMAP links to docs/README.md and docs-cht/README.md
  • Security policy: Updated supported versions table for 1.3.x

1.2.0 - 2026-03-05

Added

  • Internationalization: English documentation for international contributors
  • docs-cht/: Traditional Chinese technical documentation directory
  • docs/: English technical documentation
  • *-CHT.md: Root-level Traditional Chinese docs (README-CHT, CONTRIBUTING-CHT, SECURITY-CHT, CODE_OF_CONDUCT-CHT, HISTORY-CHT)

1.1.1 - 2026-03-05

Fixed

  • CI: Use uv run ebook-crop instead of direct execution to fix PATH in GitHub Actions

1.1.0 - 2026-03-05

Refactored

  • Modular split: Split main.py into cli.py, config.py, rotation.py, crop.py, utils.py with clear responsibilities

1.0.0 - 2026-03-05

Added

  • Margin cropping: Configurable top/bottom/left/right margin crop amounts for better ebook layout
  • Page range: Start/end page settings; optionally skip cover and back cover
  • Page rotation: Arbitrary-angle rotation for specified pages
  • Rotation config format:
    • Single: page = 3
    • Multiple: pages = "1,3,5" or pages = [1, 3, 5]
    • Range: pages = "3-9"
    • To last: pages = "3-0" (0 = last page)
    • Full: pages = "0-0"
    • Skip: skip = 1 for every other page
  • Batch mode: Processes all PDFs in input/ when no args given
  • Config traceability: Copies config as filename.toml to output directory
  • Config template: config-sample.toml; local config.toml gitignored

Fixed

  • Windows console Unicode encoding (_safe_print)
  • Process exit and resource cleanup (try/finally, garbage=1)
  • Start page description (0 and 1 both mean crop from cover)

Technical

  • Python 3.10+
  • PyMuPDF 1.24+
  • TOML config (tomli)
  • uv environment management

0.1.0 - Initial release

  • Basic PDF margin cropping
  • config.toml margin settings
  • Single-file and batch processing