Noncubic magnetic anisotropies in bulk and thin-film garnets