Only first widths size is generated

This issue has been created since 2021-01-27.

Hello, I'm using Windows. I have the following code I've copied from Zach's blog (https://www.zachleat.com/web/eleventy-image/):

const Image = require("@11ty/eleventy-img");  
(async () => {  
  let stats = await Image("source/photo-1462331940025-496dfbfc7564.jpg", {  
    formats: ["avif", "webp", "jpeg"],  
    widths: [600, 1200, 1800],  
  });  
  console.log(
    Image.generateHTML(stats, {
      alt: "A bomb ass nebula",
      loading: "lazy",
      decoding: "async",
    })
  );
})();

When I run node index.js only the 600 sized image is generated. That is also the only size output in generateHTML. Is my code wrong please?

zachleat wrote this answer on 2021-01-28

What happens when you remove the formats key altogether?

patrickgrey wrote this answer on 2021-01-28

I get the default jpeg and webp formats at 600w plus this output:

<picture>
  <source type="image/webp" srcset="/img/1789942c-600.webp 600w">
  <img src="/img/1789942c-600.jpeg" width="600" height="569" alt="A bomb ass nebula" loading="lazy" decoding="async">
</picture>

Sorry, I should have posted the HTML output in the first post. Doh!

zachleat wrote this answer on 2021-01-28

Ah sorry, as noted in the docs this is by design. “Never upscales raster images larger than original size” unless you’re using SVG as an input file. If you want the larger images you’ll need to get a larger source image!

https://www.11ty.dev/docs/plugins/image/

More Details About Repo
Owner Name 11ty
Repo Name eleventy-img
Full Name 11ty/eleventy-img
Language JavaScript
Created Date 2020-04-18
Updated Date 2022-09-22
Star Count 343
Watcher Count 15
Fork Count 29
Issue Count 16

YOU MAY BE INTERESTED

Issue Title Created Date Comment Count Updated Date
Safari Extensions don't work 1 2022-09-03 2022-09-09
uYouPlus permissions error while downloading any video 4 2022-09-03 2022-09-09
A non trollstore app with the same identifier is already installed. 2 2022-09-03 2022-09-09
旧版本 iOS fontWeight 600 依旧会双层叠影 0 2022-08-10 2022-09-08
整理高频字进 baseSplit.woff 0 2022-07-16 2022-09-07
[BUG] Cannot upload more photos right after creating an album 1 2022-09-09 2022-09-20
Unable to build: missing github.com/auth0-community/[email protected] 0 2022-03-26 2022-08-12
UI Dimmer missing in page 7 2019-12-07 2022-07-25
Please add multiple number account support in single molly app. 0 2022-03-05 2022-09-28
No connection adapters were found 1 2020-11-10 2022-07-19
Please add Bongard-HOI and RelViT 2 2022-05-30 2022-08-03
Errors when building Tensorflow in Ubuntu 2020.4 in a Virtual Machine 3 2021-01-19 2022-07-16
Use of uninitialized value $proto in socket 12 2020-09-13 2022-09-13
Ocelot with WebSockets returns 499 on IIS 1 2021-05-13 2022-08-03
Make other source-views first-class 0 2021-08-05 2022-07-22
Deconz some Legrand switch impossible to perform inclusion 71 2020-04-09 2022-08-06
session.StreamRawQueryInto include id in result (not metadata) 1 2021-04-08 2021-12-28
q = q.OrderBy("*** as double") 4 2021-04-23 2021-12-28
Add Reference Collection to IndexCreationTask 3 2021-07-15 2021-12-28
Client should not panic if an operation doesn't return anything 0 2021-08-18 2021-12-28
Small bug in handling of streamed data from callable flow.*.stream 6 2022-01-18 2022-09-30
Work on bottom and center? 1 2021-06-02 2022-07-06
[master] Multistore - Custom field photo upload at registering not accepted 2 2022-07-07 2022-09-25
Add yearly schedule to /broadcast 0 2022-01-11 2022-02-22
Use integrated shrinking instead of type-based shrinking 28 2020-07-23 2022-09-28
verilog `resetall directive clears defined macros 0 2022-07-12 2022-08-09
Release KCor 2.0.36 0 2021-01-11 2022-01-12
Prebuild logs view broken when triggering a prebuild manually 0 2022-07-01 2022-09-07
Installation issue: ascent 1 2022-07-25 2022-09-06
Dropping rpaths of "system paths" considered harmful 0 2022-07-25 2022-09-16
Remove dependencies with "bad" license. 11 2022-01-24 2022-08-19
Sync-CsOnlineApplicationInstance cmdlet is currently returning an issue "An item with the same key has already been added." 2 2022-06-01 2022-09-24
Heroic launches into a blank screen at startup((Versions 1.8.2+)) 1 2021-08-20 2022-07-19
Replica failed 9 2022-01-10 2022-01-16
ci: wine install broken 0 2022-01-07 2022-09-29
Errors shortly after SentryAndroid.init do not affect the session 3 2022-09-13 2022-09-22
KeyManager API do not follows specification when importing keys. 1 2022-06-16 2022-06-27
GraphQL 17.x Instrumentation for LTS support on that framework 1 2021-08-31 2022-08-02
Normal Tab switches to private browsing after closing the app 1 2022-07-15 2022-07-16
AnimatedSprite3D margin calculation seems slighlty off by a couple of pixels, compared to AnimatedSprite2D 3 2022-07-27 2022-09-01
Blurry Mapbox SATELLITE_STREETS tiles beyond ZOOM 17.5 0 2020-10-08 2022-09-22
dies, Error: Render frame was disposed before WebFrameMain could be accessed 6 2021-11-11 2022-03-30
Remove CUPS_RESYNC_INTV from default station.conf 0 2022-01-25 2022-09-25
`ignoreChanges` does not respect paths with bracket notation 0 2022-02-26 2022-09-11
Exception with message "No identifier specified for entity" is thrown at startup of a Docker native image 0 2021-09-24 2021-09-27
Error install on windows 0 2018-09-21 2022-08-07
how to map default url to instant Application? 1 2017-11-24 2022-09-25
Cron "System error" spilo-14:2.1-p5 2 2022-04-16 2022-09-22
Deep Diff checking is not working 17 2020-03-12 2022-09-26
[Feature request] Include only one icon with webpack 3 2021-08-20 2022-08-25