Teasers load the original images, up to several MB each: the front page weighs 14 MB
Maintainers usually reply within 1 day
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 35/100
- Issue type
- Feature
- Clarity
- Clearly specified
- Activity status
- Stale
- Tech stack
- javascript, php
- Domain
- frontend, performance
Research direction
The teaser image is created in peer_reviewed_article.php; start by reading how it calls HyphaImage::getUrl($w, $h) and how image dimensions are available. Implement the expected proportional scaled image, dimensions, and lazy loading, then verify the teaser output and front-page image loading. Pull request #673 is already open for this issue.
Written by the indexing model from the issue text.
Description
Problem
The front page of a site with articles weighs 14 MB. Lighthouse gives performance 70, with a Largest Contentful Paint of 31.6 s on a throttled connection.
- Every teaser of an article with a featured image (
img.featured_image, made inpeer_reviewed_article.php) loads the original upload. These are often PNG screenshots or camera photos of 2–3 MB, shown a few hundred pixels wide. On the measured page the three largest were 2.8 MB each, and Lighthouse estimates 9 MB of savings on images alone. - The images have no
widthandheight, so the page shifts while they load ("unsized images"). - They load all at once, also the ones far below the fold.
HyphaImage can only crop to a fixed width and height (getUrl($w, $h)), not scale to a width while keeping the proportions.
Expected
- A teaser loads a version scaled down to a width that is sharp in the layout, also on a screen with a high pixel density.
- The image has its
widthandheight. - It loads when it comes into view (
loading="lazy").
- Dominant language
- JavaScript
- Stars
- 5
- Forks
- 9
- Avg merge
- 18h 49m
- Merged PRs (30d)
- 13
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from PlanBCode/hypha
-
Component: User interface Impact: Low Level: Easy Pagetype: Peer reviewed article Type: Bug Value: Visitors
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
Maintainers usually reply within 1 day
-
Impact: Medium Level: Easy Type: Bug Value: Users
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
Maintainers usually reply within 1 day
-
Impact: Low Level: Easy Pagetype: Festival Type: Bug Value: Coders
Difficulty 1/5 Under an hour Newbie friendliness 82/100
Maintainers usually reply within 1 day
-
Impact: Medium Level: Easy Pagetype: Mailinglist Type: Bug Value: Users
Difficulty 2/5 1-3 hours Newbie friendliness 79/100
Maintainers usually reply within 1 day
-
Impact: Low Level: Easy Type: Bug Value: Coders
Difficulty 1/5 1-3 hours Newbie friendliness 85/100
PlanBCode/hypha#586 · 1 comment ·
Maintainers usually reply within 1 day
Similar issues
-
Upgrade listener stays on a custom server after close when `preClose` is setPossibly taken @RaphaelFakhri claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
fastify/fastify-websocket#388 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
DietrichGebert/ponytail#1343 ·
Maintainers usually reply within 1 day
-
cleanup
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
swombat/souls-house#770 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day