getgrav / getgrav/grav-plugin-admin

Generate image alternatives when uploading

Open
#806 3 comments 1 reaction 0 assignees View on GitHub
enhancement
Dominant language
PHP
Stars
377
Forks
225
Avg merge
11h 51m
Merged PRs (30d)
4

Description

I've been using Grav's image editing functionality quite heavily and reported several issues around it over the last few months. It's a great feature, but performing image editing operations at request time can be rather costly, especially when using `ImageMedium#derivatives`, which generates image variations for the srcset HTML attribute. But Grav also supports pregenerated responsive image variations, through a file naming convention.

I think it would be logical to add a feature to the admin panel that would generate a configurable set of image variations at upload time. This would ensure that the first request to the page wouldn't be slow, and it would be a transparent feature that mimics how a lot of other CMS's work.

The problem I'm trying to address here is that slow initial request, and I thought of suggesting a solution where the admin panel would also render the page after saving it, triggering any heavy image processing before the first visitor would arrive to the page. These two features could maybe complement one another, but the former seemed like the most logical one to begin with.

Contributor guide

Open the contributing guide

Research direction

Start by reviewing the admin panel's image-upload flow and Grav's existing pregenerated responsive-image naming convention described in the issue. Define how the configurable variations should be selected and verify that uploads generate them before the first page request; no files or tests are named in the payload.

Written by the indexing model from the issue text.

Assessment

Tech stack
php
Domain
backend
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.