The most upstream leading-end position detecting process RB1 will be described in the following paragraphs with reference to FIG. 8. As the most upstream leading-end position detecting process RB1 starts, in RC1, the CPU 40 appoints a pixel position as the objective position TMDP. In particular, the CPU 40 may appoint the central pixel position as the objective position TMDP if no objective position TMDP is appointed yet in RB1. If any of the pixel positions is appointed already as the objective position TMDP in RB1, the CPU 40 may appoint a pixel position, which is apart upstream from the currently appointed objective position TMDP for a distance equivalent to a predetermined quantity of, e.g., 10, pixels along the main-scanning direction MD, as a new objective position TMDP. Generally, a dimension of an obstacle, such as paper dust, which may be erroneously detected as an edge, may be 0.8 mm or smaller. Meanwhile, the resolution of the image reader 24 in the main-scanning direction MD in the present embodiment is 300 dpi. In this regard, the sequentially appointed adjoining objective positions TMDP are apart from each other for a distance corresponding to 10 pixel; therefore, the objective positions TMDP may be appointed at each 0.85 mm. In other words, presence of an edge in the objective position TMDP may be examined at every 0.85 mm along the main-scanning direction MD so that the CPU 40 should avoid erroneously detecting the same obstacle twice consecutively as edges.