-
Notifications
You must be signed in to change notification settings - Fork 15
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
Stripping image dimensions from file name. #43
Comments
This is happening due to https://github.com/humanmade/tachyon-plugin/blob/master/inc/class-tachyon.php#L770, which will strip This is somewhat mitigated in Photon by a Maybe if we could somehow use the image ID to work out what the original image is better, then that would work? Just an idea. |
How do you propose doing that @joehoyle I know not all media has I also know that Just a few thoughts. Also monitoring this issue to see what the solution will be out of interest :) |
I think we'd use |
I think we should remove any file name suffixes like |
Tachyon would previsouly assume that an image with a suffix like `-123x456.jpg` was from a thumbnail and attempt to infer the size from that. This update checks whether that suffix matches an image GUID, if it does then its an original file and should not have the dimensions inferred or have the suffix stripped off. Fixes #43
As of WP 5.3.1 any files uploaded with a suffix like I have a proposed solution that tries matching on the attachment GUID to see if the image URL is the original one or not in #62 - it works but there are some performance concerns. In theory the cases where the lookup is used / needed should be somewhat limited. Ideally we should recommend / provide a migration script to update image files with dimension suffixes. |
We should document the use of this CLI command for fixing the issue: |
It seems tachyon is experiencing some odd behaviour when the file name include a dimension. If the origianl file had a dimension portion of the file name, the request 404s, but the stripping itself leaves a
px"
remnant.The text was updated successfully, but these errors were encountered: