[AC-5323] iOS: toImage doesn't returns a valid Ti.Blob
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | n/a |
Status | Resolved |
Resolution | Not Our Bug |
Resolution Date | 2017-10-30T13:21:36.000+0000 |
Affected Version/s | n/a |
Fix Version/s | n/a |
Components | Titanium SDK & CLI |
Labels | iOS, toImage |
Reporter | Jorge Macias Garcia |
Assignee | Shak Hossain |
Created | 2017-10-30T09:59:49.000+0000 |
Updated | 2017-10-30T13:46:50.000+0000 |
Description
When try to get a image from a group of views or a simple label toImage method returns a invalid Ti.Blob
This works fine on Android returning the right Ti.Blob
Sample:
index.js
$.addListener($.index, 'open', function(e){
$.sample.toImage(function(blob){
$.img.setImage(blob);
});
});
$.index.open();
index.xml
<Alloy>
<Window layout="vertical">
<Label id="sample" text="This is my label" />
<ImageView id="img" />
</Window>
</Alloy>
[ERROR] Script Error {
[ERROR] column = 27;
[ERROR] line = 42;
[ERROR] message = "invalid image type";
[ERROR] nativeLocation = "-[TiUIImageView setImage_:] (TiUIImageView.m:751)";
[ERROR] nativeReason = "expected TiBlob, String, TiFile, was: __NSDictionaryM";
!image-2017-10-30-10-58-05-716.png|thumbnail!
Attachments
File | Date | Size |
---|---|---|
image-2017-10-30-10-58-05-716.png | 2017-10-30T09:58:06.000+0000 | 24674 |
Hello [~jormagar], Thanks for sharing with us. Can you please run the command from your command line: *appc info* and send us the output in a text file?
Hello, please close this issue. The BLOB is inside the callback param: $.view.toImage(function(e){ $.img.setImage(e.blob); //It works } Please, check the documentation, there is a mistake. The callback param should be a dictionary instead a blob. But on Android we are receiving a blob instead a dictionary. Parity discrepance between IOS - Android. http://docs.appcelerator.com/platform/latest/#!/api/Titanium.UI.View-method-toImage
More info: As you can see in the code, we have a little discrepance.
Thanks [~jormagar]. But does it not work on Android when using a dictionary? That'd indeed be a parity issue.