#!/usr/bin/env ascript
import(sdl)
import(jpeg)

sdl.Init(sdl.INIT_EVERYTHING)
img = image(sys.argv[1])
screen = sdl.SetVideoMode(img.width, img.height, 16, sdl.SWSURFACE)
screen.PutSurface(sdl.CreateRGBSurfaceFrom(img), 0, 0)
screen.UpdateRect()
repeat {
	event = sdl.WaitEvent()
	if (event.type == sdl.QUIT || \
		(event.type == sdl.KEYDOWN && event.sym == sdl.K_ESCAPE)) { break }
}
