getgrav / getgrav/grav-plugin-admin
Generate image alternatives when uploading
- 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
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