title: Handling download of very large images with SDWebImage
body: <p>I use <code>SDWebImage</code> to download images asynchronously to my <code>UIImageView</code>s. Most images that received are of acceptable sizes, and can be easily downloaded, and set to the <code>UIImageView</code>s.</p>
  
  <p>However there are times, when the source image at the URL is of insanely high resolution (relative to the size of my <code>imageView</code> - 60x60). In such cases, the image is never set. Sometimes my app crashes, sometimes, nothing happens (image stays <code>nil</code>), and in a very rare case I received an error something like : <code>Unable to allocate 400000 bytes of memory</code> (I am not entirely sure of the exact error log, I apologise).</p>
  
  <p>For example, <a href="http://passets-ec.pinterest.com/images/about/logos/Pinterest_Favicon.png" rel="noreferrer">this</a> image of the pinterest icon from Pinterest's site itself is enormous (10000 x 10000). My <code>imageView</code> can never plot this image. For the time being, I have hardcoded to replace the image with <a href="https://cdn1.iconfinder.com/data/icons/Pinterest/128/Pinterest_Favicon.png" rel="noreferrer">this</a>, but I know this is bad practice. Also, this is just one case, there might be infinitely more images such as this that might screw with the user experience.</p>
  
  <p>How can I handle such cases ?</p>