title: Estimate size image will be after resizing with only url without downloading it
body: <p>I understand it is most likely impossible, but I'm also open to other suggestions.</p>
  
  <p>The problem here is simple, I have this backend API which receives a list of URLs containing very large images, which then are downloaded, resized, zipped and sent back.</p>
  
  <p>There's a maximum size allowed for all resized images togheter, problem is I'm calculating the size client-side only, so if someone maliciously sends very large images it will probably overload the server memory as all the logic is handled in-memory.</p>
  
  <p>Is there a way for me to validate this server-side? From a list of URLs containing images of no particular pattern/size I want to know if their total size after resizing them will pass a certain limit</p>
  
  <p>I know its possible to know the image size by looking at the content-lenght header, but not sure if I can estimate/calculate the size after resizing, specially not knowing the dimensions.</p>
  
  <p>I'm tagging python and PIL as these are the tools I'm using but I'm not sure if any code is necessary here, its mostly a conceptual question.</p>