Exif Image Rotation (fork) — correctly oriented thumbnails

This extension is a fork of threedi/exir by 3Di. It fixes two annoying bugs hit in production on the forum.

Fixes shipped

  • Thumbnail aspect ratio — phpBB computed new_width / new_height against the original (un-rotated) dimensions. After a 90° or 270° rotation, the physical dimensions are swapped: the fork recomputes the target size from the actual post-rotation size. No more squashed thumbnails.
  • Memory leak — the original code used register_shutdown_function recursively when the thumbnail did not yet exist, which could trigger an infinite loop and exhaust PHP memory (1 GB RSS per request observed). The shutdown callback has been removed: the core.thumbnail_create_before event already handles orientation at creation.

Installation

Copy the extension to phpBB/ext/bastien59960/exir, then enable it via ACP > Customise > Extensions > Exif Image Rotation (Fork). If the original threedi/exir is installed, disable it first — the DB migration detects the existing config and will not re-apply it.

Credits

Original author: 3Di — phpbbstudio.com. Fork under GPLv2.