Plugin Directory

Changeset 3420166


Ignore:
Timestamp:
12/15/2025 01:12:11 PM (4 months ago)
Author:
algryshko
Message:

Fixes thumbnail filename conflicts when multiple images share the same filename.

Location:
liteimage/trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • liteimage/trunk/CHANGELOG.md

    r3392391 r3420166  
    55The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
    66and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
     7
     8## [3.3.1] - 2025-12-15
     9
     10> **🐛 Bugfix Release: Unique Thumbnail Filenames**
     11>
     12> Fixes thumbnail filename conflicts when multiple images share the same filename.
     13
     14### 🐛 Fixed
     15
     16- **Thumbnail Generation**: Added attachment ID to thumbnail filenames to ensure uniqueness when multiple images have identical filenames. This prevents WordPress from serving incorrect thumbnails when images share the same base filename.
     17  - Format changed from: `{filename}-{size_name}.{ext}`
     18  - To: `{filename}-{attachment_id}-{size_name}.{ext}`
     19  - Affects all thumbnail variants: WebP, original format, and retina (@2x) versions
     20
     21### Technical Details
     22
     23- `src/Image/ThumbnailGenerator.php` – Updated `generate_thumbnails()` method to include attachment ID in all generated thumbnail filenames (WebP, original format, retina variants)
     24- Thumbnail cleanup functionality remains unchanged and works correctly with the new naming format
    725
    826## [3.3.0] - 2025-11-07
  • liteimage/trunk/liteimage.php

    r3392391 r3420166  
    44Plugin Name: LiteImage
    55Description: Optimizes images with dynamic thumbnails, WebP support, and accessibility.
    6 Version: 3.3.0
     6Version: 3.3.1
    77Author: Oleksandr Gryshko
    88Author URI: https://github.com/Sanetchek
  • liteimage/trunk/src/Image/ThumbnailGenerator.php

    r3392779 r3420166  
    143143            $webp_path = str_replace(
    144144                basename($file_path),
    145                 basename($file_path, '.' . $original_extension) . "-$size_name.webp",
     145                basename($file_path, '.' . $original_extension) . "-$attachment_id-$size_name.webp",
    146146                $file_path
    147147            );
    148148            $orig_ext_path = str_replace(
    149149                basename($file_path),
    150                 basename($file_path, '.' . $original_extension) . "-$size_name." . $original_extension,
     150                basename($file_path, '.' . $original_extension) . "-$attachment_id-$size_name." . $original_extension,
    151151                $file_path
    152152            );
    153153            $retina_webp_path = str_replace(
    154154                basename($file_path),
    155                 basename($file_path, '.' . $original_extension) . "-$retina_size_name.webp",
     155                basename($file_path, '.' . $original_extension) . "-$attachment_id-$retina_size_name.webp",
    156156                $file_path
    157157            );
    158158            $retina_orig_path = str_replace(
    159159                basename($file_path),
    160                 basename($file_path, '.' . $original_extension) . "-$retina_size_name." . $original_extension,
     160                basename($file_path, '.' . $original_extension) . "-$attachment_id-$retina_size_name." . $original_extension,
    161161                $file_path
    162162            );
  • liteimage/trunk/src/Plugin.php

    r3392391 r3420166  
    3535     * @var string
    3636     */
    37     const VERSION = '3.3.0';
     37    const VERSION = '3.3.1';
    3838
    3939    /**
Note: See TracChangeset for help on using the changeset viewer.