[AC-2062] Mobile Web: ImageView doesn't work properly with images assigned as files
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | n/a |
Status | Closed |
Resolution | Cannot Reproduce |
Resolution Date | 2013-03-13T17:09:57.000+0000 |
Affected Version/s | n/a |
Fix Version/s | n/a |
Components | Titanium SDK & CLI |
Labels | n/a |
Reporter | Roman Kamenetsky |
Assignee | Ritu Agrawal |
Created | 2013-03-13T15:45:42.000+0000 |
Updated | 2016-03-08T07:41:01.000+0000 |
Description
Bug description: ImageView doesn't display an image if it is assigned as a Titanium.File. Assigning an image as path to the file works properly.
Steps to reproduce:
- 1. Create an ImageView and assign a Titanium.File to the "image" property
- 2. Run application
Expected behavior: application should run and show an image.
Actual behavior: application runs but doesn't show an image. The HTML generated for the image has the actual binary image content in the "src" attribute of the "img" tag (base64 was probably intended).
Code example: assuming that you have a proper image in resourseDirectory/images/
var self = Ti.UI.createView();
var imageView = Ti.UI.createImageView({
image: Ti.Filesystem.getFile(Ti.Filesystem.resourcesDirectory, '/images/apple_logo.jpg'),
width: 100,
height: 100
});
self.add(imageView);
I cannot reproduce this issue. I tried the code you sent, placing an image in the Resources folder, and it is shown up correctly. I used SDK 3.1.0.v20130312161655
It seems that it doesn't work only on Chrome. Have you tried it on Chrome?
We tried to reproduce the issue with a sample case with Titanium 3.1.3. However, we were not able to reproduce the issue in Mobile Web. Please test the sample and let us know if the issue persists.
Test Environment:
OS: MAC OS X 10.8.5 Ti SDK: 3.1.3 GA, 3.2.0.x Ti CLI: 3.3.0 Google Chrome, FirefoxTest Code
Step to reproduces
Create a new project
Paste this code in app.js file
Add image in images directory inside resources directory
Run this in mobile web
Image will display
Expected Result
Image will display