Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Possible to copy image (passthrough) rather than reprocess? #183

Open
mbforbes opened this issue May 6, 2023 · 1 comment
Open

Possible to copy image (passthrough) rather than reprocess? #183

mbforbes opened this issue May 6, 2023 · 1 comment
Labels
enhancement New feature or request

Comments

@mbforbes
Copy link

mbforbes commented May 6, 2023

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!!

@elmuerte
Copy link

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.

@zachleat zachleat added the enhancement New feature or request label Feb 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants