Commodity costs have eaten into quarterly earnings at US-based J&J Snack Foods.