; docformat = 'rst'
;+
; Simple routine to display an image file in one of the common image file
; formats.
;
; :Params:
; filename : in, required, type=string
; filename of image file to read and display
;-
pro mg_display_imagefile, filename
compile_opt strictarr
on_error, 2
status = query_image(filename, info)
im = read_image(filename)
window, /free, xsize=info.dimensions[0], ysize=info.dimensions[1]
case info.channels of
1: tv, im
3: tv, im, true=1
else: message, 'unable to display image'
endcase
end
; main-level example program
mg_display_imagefile, file_which('people.jpg')
end