Doesn't like iPhone 6 Plus
Still working on tracking this down (and updating the unit tests to run on 64-bit devices…), but it looks like there are a couple of places that the code only handles the 2x case for scale > 1, and gives the wrong results on the 6 Plus's 3x Retina display.
Yeah, so the IO in __OGImage is hardcoded to only know about 2x. Modifying the method that writes the file to disk to add the correct suffix would be simple enough, but how to modify the reading side is less clear.
Right now, -initWithDataAtURL: will try the URL you give it, and then try that same URL with .@2x added on. To abstract that further would mean something like:
- Expanding the range of possible scales it might guess.
- Replacing the hardcoded 2x with the scale of the main screen.
- Enumerating the directory contents, looking for files that have the given URL as a prefix.
I don't love any of those options. Anything that casts a wide enough net to seem useful also seems like it'd be pretty slow for the primary intended use case of a cache lookup.
Sorry I missed this, @sixten. Looking into it now. What did you wind up doing in your project?
What I ended up implementing was the first option, though I'm still not sure that I love any of them. I meant to submit a pull request once we'd been using the new code for a while, but obviously I forgot to do that.