OGImage icon indicating copy to clipboard operation
OGImage copied to clipboard

Doesn't like iPhone 6 Plus

Open sixten opened this issue 11 years ago • 3 comments

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.

sixten avatar Nov 04 '14 19:11 sixten

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.

sixten avatar Nov 04 '14 23:11 sixten

Sorry I missed this, @sixten. Looking into it now. What did you wind up doing in your project?

artgillespie avatar Dec 10 '14 06:12 artgillespie

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.

sixten avatar Dec 10 '14 15:12 sixten