Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-25504] -2436h@3x Images on iPhone X are not used when -736h@3x exists

GitHub Issuen/a
TypeBug
PriorityCritical
StatusClosed
ResolutionFixed
Resolution Date2017-11-13T20:59:18.000+0000
Affected Version/sRelease 6.3.0
Fix Version/sRelease 7.0.0
ComponentsiOS
Labelsimages, iphone, iphoneX
ReporterThomas Neerup
AssigneeHans Knöchel
Created2017-11-13T07:59:27.000+0000
Updated2017-11-13T21:33:15.000+0000

Description

When using image-2436h@3x.jpg images are not picked up when running on iPhone X if an image-736h@3x.jpg exists. It works fine with splash screens but not on other images. The code below should be checking if running on iPhone X or iPhone 6/7 Plus and choose file accordingly.
	if ([TiUtils isRetinaHDDisplay]) {
		// first try -736h@3x iPhone 6 Plus specific
		NSString *testpath = [NSString stringWithFormat:@"%@-736h@3x.%@",partial,ext];
		if ([fm fileExistsAtPath:testpath]) {
			return [NSURL fileURLWithPath:testpath];
		}
    
    		// second try -2436h@3x iPhone X specific
    		testpath = [NSString stringWithFormat:@"%@-2436h@3x.%@", partial, ext];
    		if ([fm fileExistsAtPath:testpath]) {
    			return [NSURL fileURLWithPath:testpath];
   		}

    		// third try plain @3x
		testpath = [NSString stringWithFormat:@"%@@3x.%@",partial,ext];
		if ([fm fileExistsAtPath:testpath]) {
			return [NSURL fileURLWithPath:testpath];
		}
	}

Attachments

FileDateSize
iPhoneXTest.zip2017-11-13T08:46:33.000+00008337414

Comments

  1. Mostafizur Rahman 2017-11-13

    Hello [~thomas.neerup@eg.dk], Thanks for sharing with us. We are not clear about your issue. Are you using Appcerelerator Titanium or objective C? It would be better if you can share the complete test code and test case so that we can reproduce the issue on our end. Best
  2. Thomas Neerup 2017-11-13

    Hi Mostafizur I'm using Appcelerator studio.. The code included is from Github titanium_mobile/iphone/Classes/TiUtils.m and illustrates where I think the problem is. I'm just setting creating a Window with a backgroundImage and the wrong image is picked up by titanium..
  3. Thomas Neerup 2017-11-13

    Test case added.. When running on iPhone X I would expect the background image without the top border to be picked up... But the image with the border is picked up. I'm not using app thinning. false
  4. Hans Knöchel 2017-11-13

    This is a valid issue! And sorry for not seeing that earlier. We'll provide a patch today and it will be part of the next release (7.0.0).
  5. Hans Knöchel 2017-11-13

    PR: https://github.com/appcelerator/titanium_mobile/pull/9592 Test-case: See the original tests in TIMOB-25269.
  6. Eric Wieber 2017-11-13

    Verified in SDK build 7.0.0.v20171113113154

JSON Source