split one double image into two single images


Put the following prototype in the prototypes section of the application program header file:

int ( __stdcall *pfnFFSplitBC )( char* );


Separate a double-A4 sized document, printed both sides, into four A4 images.

Description and use

As you know the area of an A3 sized sheet is equal to the area of two A4 sized sheets one beside the other. Many times the A3 sized sheet (printed both sides) is folded in the center, and is actually a four A4 sized faces document.

To load the images of this kind of document into an optical storage and retrieval system you can't simply pass the unfolded A3 sheet through the scanner because the images of its two sides displayed on the screen, at retrieval time, would result hard to deal with.

The best thing is to pass the unfolded A3 sheet through the scanner, and later separate the four A4 images that actually compose the document.

Look at this sketch to see what I mean.

If you get some "address violation error" when using this function it means that the input file to split exceeds the dimension of the A3 size sheet.


In the preceeding paragraph we have talked about A3 and A4 sizes, but actually this function works with any image size. The function only separates the images according to the working scheme provided in the

  • complete path and filename of the image to split (it's a char*)

Return value

The two TIFF files with the images resulting from the splitting of the TIFF file to split are automatically created in C:\, and their names are B.TIF and C.TIF. Yes, I know, that's horrible, but when I wrote the function I was in a hurry. After all, though, it works !

The function returns an integer:

  • 0: OK, no error
  • 1: the TIFF file to split has not been found
  • 2: the file to split is not TIFF
  • 3: fail to allocate the first memory buffer
  • 4: fail to allocate the second memory buffer
  • 5: can't create the first TIFF file (C:\B.TIF)
  • 6: can't create the second TIFF file (C:\C.TIF)

Application example

See also
  • FFSplitAD: split one double image into two single images