get_size(); $expected_width = (int)($expected[0] ?? 0); $expected_height = (int)($expected[1] ?? 0); if ($expected_width > 0 && $expected_height > 0) { if ((int)$actual[0] !== $expected_width || (int)$actual[1] !== $expected_height) { $reason = 'dimension-mismatch:'.(int)$actual[0].'x'.(int)$actual[1].'!='.$expected_width.'x'.$expected_height; return false; } } } if (is_object($params) && isset($params->last_mod_time)) { $mtime = @filemtime($target_path); if ($mtime === false || (int)$mtime < (int)$params->last_mod_time) { $reason = 'stale-params'; return false; } } $reason = 'valid'; return true; }