Commit Graph

7 Commits

Author SHA1 Message Date
Vijay Janapa Reddi
b6ce3332ad feat(deploy): add development preview banner with commit info and stable version link
- Add modify_dev_announcement.py script to inject dev preview banner
- Banner shows commit hash, timestamp, and link to stable version
- Make announcement non-dismissible for dev previews
- Maintain original blue announcement styling below dev banner
- Update deploy-preview workflow to use new script
- Script located in tools/scripts/publish/ for external workflow use
2025-08-26 01:27:20 +02:00
Vijay Janapa Reddi
5a447f0454 Removes compression scripts
Deletes the EPUB and PDF compression scripts. These scripts are no longer needed.
2025-08-21 21:26:55 -04:00
Vijay Janapa Reddi
eb09b0b011 fix(compress): add Pillow version compatibility for container environments
Fix critical issue where compression failed on images requiring resize:
- Container uses older Pillow without Image.Resampling attribute
- Added backward compatibility: try Image.Resampling.LANCZOS, fallback to Image.LANCZOS
- This was causing only 523/867 images to compress (60% completion)
- Now all images should process correctly regardless of Pillow version

Root cause: 'module PIL.Image has no attribute Resampling' error
Result: Should achieve full 77% compression in containers
2025-08-21 20:35:40 -04:00
Vijay Janapa Reddi
f54f7912ee chore(publish): remove obsolete compress_epub_lite.py
The lite version is no longer needed as the main compress_epub.py
now has optimized defaults and superior compression performance.
2025-08-21 18:52:59 -04:00
Vijay Janapa Reddi
de78c82c8d feat(publish): optimize EPUB compression defaults based on comprehensive evaluation
- Update default quality from 60 to 50 for better compression
- Update default max_size from 1200px to 1000px for optimal balance
- Based on comprehensive testing of 10 different configurations
- Achieves 77.3% size reduction (267MB → 60.8MB) automatically
- Maintains excellent image quality while staying well under 100MB target
- Updated help text and examples to reflect new optimal settings

Results: EPUB files now compress to ~61MB with 77% size reduction
while maintaining excellent readability for textbook content.
2025-08-21 18:49:38 -04:00
Vijay Janapa Reddi
1f90203eb0 feat(publish): optimize EPUB compression for better size reduction
- Remove compresslevel=9 from ZIP compression (use default for better efficiency)
- Implement aggressive PNG palette conversion for maximum compression
- Simplify JPEG transparency handling for better performance
- Update default settings: quality=60, max_size=1200px for optimal balance
- Add compress_epub_lite.py as lightweight alternative
- Achieve 75% size reduction (267MB → 67MB) while maintaining quality
- Update documentation and help text with new optimal settings

Results: EPUB files now compress to ~67MB (well under 100MB target)
with excellent image quality and 75% size reduction.
2025-08-21 18:38:54 -04:00
Vijay Janapa Reddi
41c98f49a5 refactor(tools): rename quarto_publish to publish and add professional compression scripts
- Rename tools/scripts/quarto_publish/ to tools/scripts/publish/ for cleaner organization
- Add compress_pdf.py: Professional PDF compression with Ghostscript
  * Cross-platform support (gs on Linux/macOS, gswin64c on Windows)
  * Multiple quality presets including minimal mode for exact compatibility
  * Consistent CLI interface with --input/-i and --output/-o flags
  * Comprehensive error handling and progress reporting
- Add compress_epub.py: Professional EPUB compression with image optimization
  * Optimizes embedded images while maintaining EPUB format compliance
  * Consistent CLI interface matching compress_pdf.py
  * Configurable quality and image size settings
- Update documentation to reflect new directory structure
- Both scripts use identical professional CLI patterns for consistency
2025-08-21 14:20:35 -04:00