We report a study of the spatially varying thickness of dried films of polymer solutions resulting from a nonuniform evaporation flux. The controlled heterogeneity of the evaporation flux is imposed by placing a solid mask above the evaporating film spread on a solid substrate. At the end of drying, a depression has formed under the mask, together with overthicknesses extending from the edge of the mask and over distances that may be larger than its size. By considering the flows induced in a vertically homogeneous film, we obtain analytical solutions for the thickness profiles during drying using a linear approximation in the limits of either gravity or capillarity-driven flows. We demonstrate that gravity can play a role in the deformations of the films, even if their initial thicknesses are 1 order of magnitude smaller than the capillary length. In addition, we examine two possible reference states for the linear approximation, i.e., far from the mask in the film of decreasing thickness and increasing viscosity, or under the mask where no evaporation occurs. We further compare these results with experimental ones obtained by drying thin films of polymer solutions under a mask. Both the extent and amplitude of the thickness heterogeneities of the dry film are quantitatively predicted by the linear analysis for a reference state under the mask. Our results therefore provide new insight on the patterns resulting from evaporation masks and can be generalized to minimize thickness heterogeneities in any situation in which the evaporation flux is nonuniform.