Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-18306] Better algorithm for iOS image selection

GitHub Issuen/a
TypeImprovement
Priorityn/a
StatusOpen
ResolutionUnresolved
Affected Version/sn/a
Fix Version/sn/a
Componentsn/a
Labelsimages, orientation
ReporterFokke Zandbergen
AssigneeUnknown
Created2015-01-05T15:56:42.000+0000
Updated2018-02-28T19:55:51.000+0000

Description

The image selection algorithm in TiUTils.m under [checkFor2XImage()](https://github.com/appcelerator/titanium_mobile/blob/master/iphone/Classes/TiUtils.m#L667) is missing selection by orientation and should fallback to other 16:9 screens before using the 3:4 defaults.

Current algorithm

*os* = ~ipad|~iphone   * if isRetinaHDDisplay ** image-736h@3x ** image@3x * if isRetinaDisplay ** if isRetinaiPhone6 *** image-667h@2x ** *elseif* isRetinaFourInch *** image-568h@2x ** image@2x\[os\] ** image@2x * image\[os\] * image

Better algorithm

*orientation* = Landscape|Portrait   * if isRetinaHDDisplay ** image-\[orientation\]-736h@3x ** image-736h@3x ** image@3x * if isRetinaDisplay ** if isRetinaHDDisplay *or isRetinaiPhone6* *** image-\[orientation\]-667h@2x *** image-667h@2x ** *if* isRetinaFourInch *or isRetinaHDDisplay or isRetinaiPhone6* *** image-\[orientation\]-568h@2x *** image-568h@2x ** image-\[orientation\]@2x[os\] ** image@2x\[os\] ** image-\[orientation\]@2x ** image@2x * image-\[orientation\]\[os\] * image\[os\] * image-\[orientation\] * image

Comments

  1. Fokke Zandbergen 2015-01-05

    I can do a PR if you agree with the logic.

JSON Source