proposal.md 1.1 KB

Change: Fix PNG Format Compatibility Issues

Why

Users are reporting that generated PNG images cannot be opened in Adobe Photoshop, showing "file format module cannot parse the file" errors. However, these same files can be opened after being sent through WeChat, indicating that the PNG files have header or format inconsistencies that prevent professional image editing software from properly reading them.

What Changes

  • Implement standard PNG format validation using Pillow (PIL) library
  • Add PNG file re-writing to ensure compliance with PNG specification
  • Maintain backward compatibility with graceful fallback to original method
  • Fix both generated images and reference images in all save locations
  • Ensure all PNG files have proper headers, metadata, and compression

Impact

  • Affected specs: image-generation, image-saving, history-management
  • Affected code: image_generator.py, HistoryManager class
  • Breaking changes: None (pure enhancement with fallback)
  • Performance impact: Minimal overhead for PNG re-writing
  • User experience: Significantly improved compatibility with professional tools