# Square Thumbnails - Version 2.3.1

## Release Date: May 16, 2025

### 🐛 Bug Fixes

#### Bulk Regeneration Issues
- **Fixed bulk regeneration stopping after first batch**: The bulk regeneration process would stop after processing only 5 images due to incorrect offset handling
- **Fixed incorrect total count display**: Bulk regeneration now shows the correct total number of images instead of always displaying "5/5"
- **Fixed Force regeneration for all images**: When "Force regenerate" is enabled, all images are now properly regenerated, including those without existing metadata
- **Fixed specific images not regenerating in bulk**: Resolved issue where certain images would only regenerate individually but not during bulk operations

#### Background Transparency Support
- **Added JPEG to PNG conversion for transparent backgrounds**: JPEG images are now automatically converted to PNG format when transparent background is selected, ensuring proper transparency support
- **Fixed metadata updates for converted images**: Properly updates file extensions and MIME types when images are converted from JPEG to PNG

#### Processing Logic Improvements
- **Fixed duplicate -sqt suffix**: Images no longer receive multiple -sqt suffixes during regeneration
- **Improved metadata generation**: Missing metadata is now properly generated from source files during force regeneration
- **Enhanced error handling**: Added comprehensive error logging and debugging for failed regenerations
- **Fixed WooCommerce height=0 dimensions**: Images with dimensions like 600x0 are now properly converted to square (600x600)

### ✨ Improvements

#### Enhanced Debugging
- **Added detailed debug logging**: Comprehensive logging throughout the regeneration process to help identify issues
- **Added batch processing summary**: Final summary report showing successful, skipped, and failed images
- **Added specific debugging for problematic images**: Special debugging for images that consistently fail regeneration

#### Performance Optimizations
- **Optimized batch processing**: Improved handling of large media libraries with proper batch continuation
- **Better memory management**: Added memory usage tracking for large image processing

### 📝 Technical Details

- Fixed force parameter handling in bulk regeneration
- Corrected batch offset calculations for proper pagination
- Updated file path handling for images with special characters
- Improved GD library compatibility checks
- Enhanced WebP and AVIF format support detection
- Added automatic dimension forcing for WooCommerce sizes with height=0

### 🔧 Developer Notes

The plugin now properly handles:
- Images without metadata during force regeneration
- Automatic format conversion when transparency is required
- Proper batch processing continuation regardless of skip/success ratio
- Comprehensive error reporting for troubleshooting
- Settings change detection with notification for regeneration needs