I am not from Co. Longford but I do live in Ireland. Locals may know more than me though. As I understand it, Co. Longford is about 100 miles from the sea. The town is landlocked as is most of the county, save for the River Shannon which is navigable for shallow draught craft, and for the Royal Canal. Longford town is (or was) at the end of a spur off the Royal Canal from Dublin to the Shannon, which opened around 1815. See:
Perhaps your ancestor was working on that canal? (If so, it would have had to have been after 1815). If not, he’s unlikely to have been a Harbour Master in Longford due to the general lack of sea or harbours. The Royal Canal reopened in 2010 though, as far as I am aware, the spur to Longford is still closed.
You ask about images of Longford Harbour in the early 19th century. Photography didn't really get established until the 1850s so there are unlikely to be any images from that era. There may be later images though. You could try contacting Longford library to see if they have anything.