datauri need be careful for the dirname