A non-transitory computer-readable storage medium storing a program for causing a computer to execute a method for controlling an image reading apparatus comprising:
- an image sensor in which a light receiving element is arranged in a predetermined direction for reading a document;
- a drive mechanism configured to cause the image sensor to move in a first direction intersecting the predetermined direction and a second direction opposite to the first direction;
- and a reference plate, the method comprising:
- Executing a first reading method of detecting a first reference position by driving the image sensor in the first direction and reading the reference plate, driving the image sensor in the first direction, and then reading a document, and a second reading method of detecting a second reference position by driving the image sensor in the second direction and reading the reference plate, and thereafter reading a document by driving the image sensor in the second direction.