A Joomla system plugin that generates responsive images (srcset, sizes, <picture>) from image custom fields and template overrides, with safe, cacheable thumbnail generation.
The plugin generates thumbnails on first page load and reuses them on subsequent page loads.
Compatible with Joomla 5 & Joomla 6.
- Responsive image generation (
srcset,sizes) with<picture>output - Width-based thumbnails with automatic scaling
- Never upscales images beyond original dimensions
- Automatic fallback image generation
- Preserves original image subfolder structure
- Hash-based cache invalidation
- Optional WebP support
- Optional lazy-loading
- Full template/layout override support
- SVG support (SVG images bypass resizing)
- Safe filesystem handling with locks and TTL
-
Download the latest release: https://github.com/web-tiki/joomla-responsive-images/releases
-
Install via Extensions → Install
-
Enable the plugin:
System → web-tiki Responsive Images
- Original images must be in
/images/,/media/or/templates/folders - Thumbnails are created in
/media/ri-responsiveimages/and mirror the original folder structure
Example: /images/parcs/new york/ → /media/ri-responsiveimages/parcs/new york/
- Displays debug information on the frontend (breaks layout!)
- Disabled by default for production
- Ensure cache is disabled to see accurate debug info
use Joomla\CMS\Layout\LayoutHelper;
echo LayoutHelper::render(
'responsiveimages.image',
['imageField' => $imageField],
JPATH_PLUGINS . '/system/responsiveimages/layouts'
);Default options used:
$defaults = [
'lazy' => true,
'webp' => true,
'sizes' => '100vw',
'widths' => [480, 800, 1200, 1600, 2000, 2560],
'quality' => 75,
'alt' => '',
'aspectRatio' => null,
];- Original image aspect ratio is respected
- Media field
altis used if available
use Joomla\CMS\Layout\LayoutHelper;
echo LayoutHelper::render(
'responsiveimages.image',
[
'imageField' => $imageField,
'options' => [
'lazy' => true,
'webp' => false,
'alt' => 'Custom fallback alt text',
'sizes' => '(min-width: 1200px) 50vw, 100vw',
'widths' => [320, 640, 1024, 1600],
'quality' => 85,
'aspectRatio' => 1.777,
'imageClass' => 'responsive-image',
]
],
JPATH_PLUGINS . '/system/responsiveimages/layouts'
);- Media field
alttext altoption from override- Image filename
- When enabled, only
.webpthumbnails are generated - A fallback with original image format (.jpg of .png) is generated
| Option | Type | Description |
|---|---|---|
| lazy | bool | loading="lazy" attribute |
| webp | bool | Generate WebP thumbnails |
| alt | string | Fallback alt text |
| sizes | string | sizes attribute for srcset |
| widths | array | Thumbnail widths to generate |
| quality | int | JPEG/WebP quality 1–100 |
| aspectRatio | float | Fixed height/width ratio |
| debug | bool | Display debug info on frontend |
| imageClass | string | CSS class for <img> |
-
Input: original image from media field
-
Options merge: default plugin options + override options
-
Original image metadata extraction: width, height, hash, extension
-
If original image is SVG: quick exist without generating anything. SVG image is displayed with the
<img/>tag -
Aspect ratio handling: crop box computed if aspectRatio option is set
-
Get the Requested thumbnails:
- All requested widths
- Widths > original image → generate original-size thumbnail and stop
- Fallback: largest width capped at original width and 1280px
-
Manifest loading:
.manifest.jsonfile for caching -
If manifest is up to date: got to step 10
-
Thumbnail generation: using Imagick, locks ensure concurrent safety, TTL prevents stale locks
-
Manifest updated and saved
-
Final HTML response:
<picture>element with<source>and<img>tags, including fallback and srcset
- Thumbnails generated only inside
/media/ri-responsiveimages/ - Safe concurrent generation using lock files and TTL
- Hash-based invalidation prevents stale thumbnails
- Thumbnails generated once per hash + width + quality
- Subfolder mirroring improves filesystem performance
- Locking prevents multiple simultaneous generation
- JPEG
- PNG
- SVG (not resized, output as
<img>) - WebP (optional)
- PHP ≥ 8.2
- Imagick enabled
- Sufficient disk space for thumbnails
GPL v2 or later
Created by web-tiki