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

Closed
mbforbes opened this issue May 6, 2023 · 2 comments
Closed

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

mbforbes opened this issue May 6, 2023 · 2 comments
Labels
duplicate This issue or pull request already exists 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
@zachleat
Copy link
Member

I believe this is a duplicate of #133. But I’d also post another shout to passthrough copy, which does this!

We did some work to improve this with the imminently shipping v3.0.1 to improve passthrough copy for relative asset references: 11ty/eleventy#3573 The downside there is that we passthrough copy doesn’t add the width/height attributes.

Regardless, let’s group up at #133 and #212!

@zachleat zachleat closed this as not planned Won't fix, can't repro, duplicate, stale Dec 13, 2024
@zachleat zachleat added the duplicate This issue or pull request already exists label Dec 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
duplicate This issue or pull request already exists enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants