You can obtain your visa at the airport in Tana. The procedure is very simple; you just have to pay FF160 (or the equivalent in FMG). No photos are required, and you don't need to fill in any forms. The visa is valid for one months, and it has multiple entry.
Since regulations change regularly, don't forget to get the latest information at the Embassy or Consulate of Madagascar in your country.