Two-dimensional-to-one-dimensional crossover in the Ising model