A method for controlling an image processing apparatus comprising a storage unit in which a memory area of a read buffer, an image memory, or a record buffer can be allocated, the method comprising:
- acquiring generate read data corresponding to a part of an original, the read data being obtained by a read apparatus reading a part of the original sequentially and storing the read data into the read buffer;
- storing image data corresponding to the original into the image memory, based on a plurality of the read data sequentially stored in the read buffer;
- generating recording data based on image data retrieved from the image memory, and storing the generated recording data into the record buffer
- causing a recording apparatus to record an image corresponding to the original based on the recording data stored in the record buffer;
- and
- determining a data amount of image data corresponding to the original to be stored into the image memory based on the read data stored in the read buffer;
- according to the determined data amount, allocating a memory area of the storage unit which was allocated as the read buffer when image data is stored into the image memory as the record buffer in response to completion of storing of image data corresponding to the original into the image memory;
- wherein the recording data generated based on image data retrieved from the image memory is stored in the record buffer allocated in response to the completion of the storing of image data corresponding to the original into the image memory, and based on the recording data stored in the record buffer, an image is recorded by the recording apparatus.