get dimensions from passed canvas if they exist