You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In WP when you call wp_get_attachment_image_src() for example you pass in an array for the size parameter rather than a size name, in a Tachyon context this works great. There is however a limitation in WP that you cannot specify if the image should be cropped to the dimensions or not because all it does under the hood is find the nearest actual size or set width & height attributes on an image tag.
In Tachyon we can allow for overloading this size array with a 3rd item for cropping eg:
This won't break any core code as it just references $size[0] and $size[1] directly but allows us to access $size[2] and choose whether to apply resize or fit in the tachyon URL.
The text was updated successfully, but these errors were encountered:
In WP when you call
wp_get_attachment_image_src()
for example you pass in an array for the size parameter rather than a size name, in a Tachyon context this works great. There is however a limitation in WP that you cannot specify if the image should be cropped to the dimensions or not because all it does under the hood is find the nearest actual size or set width & height attributes on an image tag.In Tachyon we can allow for overloading this size array with a 3rd item for cropping eg:
This won't break any core code as it just references
$size[0]
and$size[1]
directly but allows us to access$size[2]
and choose whether to applyresize
orfit
in the tachyon URL.The text was updated successfully, but these errors were encountered: