Details
-
Type:
Bug
-
Status: Open
-
Priority:
None
-
Resolution: Unresolved
-
Affects Version/s: Release 9.3.0, Release 10.0.0
-
Fix Version/s: None
-
Component/s: iOS
-
Labels:None
-
Environment:
MacOS Big Sur: 11.1 Beta 1
Xcode: 12.23
Java Version: 1.8.0_242
Android NDK: 21.3.6528147
Node.js: 12.18.1
""NPM":"5.0.0","CLI":"8.1.1""
iPhone 8 14.2
Description
On iOS the 2nd image which is being read in by filereader is not being loaded but on Android it works as expected.
Test Case:
var win = Ti.UI.createWindow({
|
backgroundColor:'white' |
});
|
|
|
var earthFile,
|
earthFileStream,
|
earthBuffer;
|
|
function fileReader(args) {
|
if (args.bytesProcessed === -1) { |
Ti.API.error('Done'); |
Ti.API.info(earthBuffer.toBlob().height + ' . ' + earthBuffer.toBlob().width + ' . ' + earthBuffer.toBlob().mimeType); |
earthImage.image = earthBuffer.toBlob();
|
Ti.API.info(earthImage.image.height + ' . ' + earthImage.image.width + ' . ' + earthImage.image.mimeType); |
earthBuffer.release();
|
earthImage.animate({
|
opacity: 1, |
duration: 100 |
});
|
} else { |
Ti.API.error(args.bytesProcessed + ' of ' + args.totalBytesProcessed); |
if (earthBuffer === null) { |
earthBuffer = Ti.createBuffer();
|
}
|
earthBuffer.append(args.buffer);
|
}
|
}
|
|
function loadEarth() {
|
earthImage.image = null; |
earthImage.opacity = 0; |
earthFile = Ti.Filesystem.getFile(Ti.Filesystem.resourcesDirectory, '/Earth.jpg'); |
earthFileStream = Ti.Filesystem.openStream(Ti.Filesystem.MODE_READ, earthFile.nativePath);
|
earthBuffer = null; |
Ti.Stream.pump(earthFileStream, fileReader, 512, true); |
}
|
|
var fishImage = Ti.UI.createImageView({
|
left: '10dp', |
top: '10dp', |
right: '10dp', |
height: '200dp', |
image: '/ClownFish.jpg' |
});
|
win.add(fishImage);
|
|
var earthImage = Ti.UI.createImageView({
|
left: '10dp', |
bottom: '10dp', |
right: '10dp', |
height: '200dp', |
opacity: 0 |
});
|
earthImage.addEventListener('singletap', loadEarth); |
win.add(earthImage);
|
|
loadEarth();
|
win.open();
|
Test Steps:
- Create an application with the test case above
- Make sure app thinning is disabled in the tiapp.xml
- add the two images attached below into the resources folder
- Run application on iOS
Actual result:
2nd image does not load and nothing is logged in the console.
Expected result:
2nd image should load and log the following
[ERROR] Done
|
[INFO] 1600 . 2560 . image/jpeg |
[INFO] 1600 . 2560 . image/jpeg |