tachyon-plugin icon indicating copy to clipboard operation
tachyon-plugin copied to clipboard

URL-encoded file names break source sets

Open sweber83 opened this issue 4 years ago • 0 comments

When the tachyon plugin url encodes file names, wp_get_attachment_image_srcset() always returns false. This is the case because wp_calculate_image_srcset() compares the plain file name with the url encoded url, which never results in a match.

I tried fixing the problem by url encoding the file names, too, but this leads to new problems. What I see as a possible solution, is to not encode the file names at all. This can be achieved by reverting 256b67e02fc4279b69c2c6c600339018d946b57d & 5db26831a058e37b14ec2fdc6dc4bf07018aca90 I tried this in my branch here, and it seems to work fine.

I'm not really sure, if this creates any new problems. There's another issue https://github.com/humanmade/tachyon-plugin/issues/23, which also has problems with the url encoding.

sweber83 avatar Jan 07 '22 16:01 sweber83