-
-
Notifications
You must be signed in to change notification settings - Fork 7.5k
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
resources.Copy to original resource path points to wrong resource #10412
Comments
To copy a resource to its original path is also of concern, when an image is processed more than once. In the first step, images may be resized or cropped, etc. In the second step, a "srcset" is generated, which involves again resizing or filtering. Without copying the result of the first step to the original name, Hugo’s naming scheme concatenates two hashes and other information into the resulting filenames. These names then usually get so long, that Hugo truncates them to avoid problems. The part of the filename string containing information about the last processing step is usually lost, then. |
If fixing/implementing this is going to be expensive or impossible, perhaps we could disallow using the original resource path to avoid unexpected results (e.g., incorrect |
It was certainly not intended to be used this way. The technical reason is that we use the resource path as a cache key, but even if we fix that there is a "meta question" that I cannot wrap my head around: If I do:
What would be the I do agree it's a bug, but the fix isn't obvious. I'm in the process of simplifying lots of related stuff now, I have this issue in the back of my head while doing so. |
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
This works as expected...
But if you try to copy the resource to the original path (a.jpg)...
Note that the
width
andheight
attributes are from the original image, not the resized image.Why would you want to copy a resource to its original path? To have something other than this:
The text was updated successfully, but these errors were encountered: