wordpress-mobile/WordPress-iOS — pull request #1909 by aerych (2014-07-08 18:02:07+00:00)
Title: Skip fetching a new image from the cache and just copy instead.

This is a work around for an issue retriving some images from the cache.

The issue seems to be `WPTableImageSource` `imageForURL:withSize:` returning nil if `cachedImageForURL:withSize:` doesn't find a match. If `resizesImagesSynchronously` is true, `WPTableImageSource` attempts to fetch and resize an image from the cache. This also ends up returning nil in some cases.

Digging deeper, the `CGSize` passed to MGImageUtils's UIImage+ProportionalFill `imageCroppedToSize:ignoreAlpha:` has a zero height (nothing visible for core graphic to draw so no image). The zero height comes from `cachedImageForURL:withSize:` setting the size to zero when searching the cache.

An alternate fix would be to pass the original height to the UIImage category methods but I'm not sure if that edit would have its own consequences.

Since this needs to be a simple fix for 4.2, just copying and passing the existing image seems the safe path and was the approach prior to the view refactor. Ideally the reader detail should request its own images so a more robust fix can be scoped for 4.3.