Can eleventy-img recognize images it processed from another page and not process it again like a new image?
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 467
- Forks
- 65
- PR merge metrics
- No merged PRs in 30d
Description
Hello there,
I'm not sure if this is an actual issue, a behaviour by design or if I'm just doing it wrong but on my portfolio website my homepage is displaying a grid of my photos with a link on their dedicated page.
The picture in those pages is processed as intended and will end up in the folder of the page.
The thumbnail pictures though are processed again and stored in the img folder at the root of my website.
So basically every picture is processed twice.
There is the code I use for the grid:
<li class="post">
<a href="{{ post.url }}">
{% if post.data.photo %}
<img src="/{{ post.url }}/{{ post.data.photo }}" alt="{{ post.data.photo_alt }}" sizes="(min-width: 50em) 50vw, 100vw">
{% endif %}
<h2 class="post-title">{{ post.data.title }}</h2>
</a>
</li>
I'm guessing the plugin doesn't check if it processed the picture already.
And it would be harmless on a small website but mine is already 500+ pictures which, as you may expect, makes the image processing time twice longer than it should and… needs almost twice the disk space it should.
Is there a way to avoid that?
eleventy: v3.0.0
eleventy-img: v6.0.1
Contributor guide
No contributing guide indexed for this repository
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.
Research direction
Reproduce the issue using the Nunjucks grid snippet and the reported Eleventy v3.0.0 and eleventy-img v6.0.1 versions. Compare the generated output for the dedicated page and thumbnail, then verify that avoiding duplicate processing reduces the build time and disk usage for repeated images.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- performance, tooling
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100