eleventy-img icon indicating copy to clipboard operation
eleventy-img copied to clipboard

Possible to copy image (passthrough) rather than reprocess?

Open mbforbes opened this issue 1 year ago • 1 comments

For outputting an image of the same format and size, is it possible to have eleventy-img simply copy the file rather than reprocess it?

I read through all the issues I could find that mentioned "copy" and "passthrough" but I couldn't find an answer. The closest I found was this comment:

widths: [null] (default, keep original width)

That should skip processing the images.

However, when I include null or "auto" in the widths, and I inspect those output files, they are different than the originals.

I ask because (a) I have thousands of photos, so this would help quicken deploys, and (b) I've done quite a bit of hand-optimizing exactly how the images are compressed, so I'd like to have them not re-run through a compression algorithm again.

Thank you!!

mbforbes avatar May 06 '23 06:05 mbforbes

I would also be nice if there was an option to include the original file (untouched) in the resulting image set.

So for example

Image("some-image.jps", {
  widths: [300],
  formats: ["jpeg"],
  includeOriginal: true
});

Would generate 1 image, and copy the original to the destination. The returned metadata would contain the information about both images.

elmuerte avatar May 19 '23 09:05 elmuerte