/* Classic Rexx */                                    /* R-5 */                                           /* Selene */

ImageFromFile ->                                      ImageFromFile ->                                    image-from-file = file-name + img ->
Arg File_name : String,                               Arg File_name : String,                               if bmp IS_PM_BITMAP 
    Image : &Array : Integer : 2^8                        Image : &Array : Integer : 2^8                       ' bmp = char-in file-name ->
                                                                                                              img = bmp
If BMP, IS_PM_BITMAP                                  If BMP, IS_PM_BITMAP                                  else
   With BMP from CharIn File_name 'BMP' then             ' BMP - CharIn File_name 'BMP' then                  img = convert bmp
 Image = BMP                                           Image = BMP                                          ;
Else                                                  Else                                                _
 Call Convert BMP 'Image'                              - Convert BMP 'Image'                                img : array : integer : 2^8
;                                                     ;                                                   ;
                                                                                                          
Return                                                /

FileFormat : -a ->                                    FileFormat : -a ->                                  file-format -a = bytes IS_PM_BITMAP ->
Arg Bytes : Array : Integer : 2^8,                    Arg Bytes : Array : Integer : 2^8,                    [ bytes.1 = 'B' &&
    . : IS_PM_BITMAP                                      . : IS_PM_BITMAP                                    bytes.2 = 'M' &&
                                                                                                              bytes.3 = 'N' && bytes.4 = "\0" ]
When Bytes.1 = 'B' &&                                 [ Bytes.1 = 'B' &&                                  _
     Bytes.2 = 'M' &&                                   Bytes.2 = 'M' &&                                    bytes : array : integer : 2^8
     Bytes.3 = 'N' && Bytes.4 = "\0" then               Bytes.3 = 'N' && Bytes.4 = "\0" ]                 ;
Return 1                                                                                                  
                                                      /                                                   
Else
Return 0