width and height have to be actual dimensions on the document because while it works fine on 8 bit images, a dimension of 10000 will slow down photoshop considerably on 16 bit images as it tries to allocate memory.