Diffusion in inhomogeneous films and membranes