/* BT headshot crop v3: small round MLB/MiLB headshots show the whole head (cap at top edge, chin inside). Nov 2, 2026 */ (function(){var TM='c_crop,g_north,x_0,y_0.09,w_1.0,h_0.76/c_lpad,g_north,w_120,h_120,b_auto/q_auto:best/v1/people/',TN='c_crop,g_north,x_0,y_0.03,w_1.0,h_0.74/c_lpad,g_north,w_120,h_120,b_auto/q_auto:best/v1/people/'; function small(im){var r=im.getBoundingClientRect();var w=r.width||im.width||parseFloat(im.getAttribute('width'))||0;if(!w||w>72)return false;var rad=getComputedStyle(im).borderRadius||'';var p=im.parentElement,pr=p?getComputedStyle(p).borderRadius:'';return /50%|9999|999px|100%/.test(rad+' '+pr)||parseFloat(rad)>=w/2-1||(p&&parseFloat(pr)>=w/2-1)} function fix(im){var s=im.getAttribute('src')||'';if(s.indexOf('mlbstatic.com')<0||s.indexOf('b_auto')>=0)return;var m=s.match(/\/headshot\/(67|milb)\//);if(!m||!small(im))return;var n=s.replace(/(\/upload\/(?:d_[^\/]+\/)?)(?:[^\/]+\/)*?v1\/people\//,'$1'+(m[1]==='milb'?TN:TM));if(n!==s){im.setAttribute('src',n);im.style.objectFit='cover';im.style.objectPosition='50% 50%'}} function run(){document.querySelectorAll('img[src*="headshot"]').forEach(fix)} var q;function sch(){clearTimeout(q);q=setTimeout(run,50)} function start(){run();new MutationObserver(sch).observe(document.body,{childList:true,subtree:true,attributes:true,attributeFilter:['src','class','style']});addEventListener('load',sch);setTimeout(run,1500)} if(document.readyState==='loading')document.addEventListener('DOMContentLoaded',start);else start()})();