Closed dnlowman closed 5 years ago
Hi @dnlowman not sure exactly what you refer to but I think one of the contributors fixed a problem with scaling on iOS, look at this commit. Maybe is also happening on android? is this to do with the appendBitmap command?
Hi @infoxicator, yes indeed it is in relation to the appendBitmap command, if you use a URI which is an image from the web the iOS implementation will actually resolve this and print the bitmap whereas the android implementation only searches the local filesystem so fails to print.
Hi @dnlowman, It looks like the iOS implementation creates an image regardless of the url (local or remote)
NSURL *imageURL = [NSURL URLWithString:urlString]; NSData *imageData = [NSData dataWithContentsOfURL:imageURL]; UIImage *image = [UIImage imageWithData:imageData];
whereas the android implementation explicitly loads an image from the phone's memory:
Uri imageUri = Uri.parse(uriString);
Bitmap bitmap = MediaStore.Images.Media.getBitmap(contentResolver, imageUri);
The purpose of this command was always intended to be printing from the phone's memory not remote. One solution is to download your image and then pass it to appendBitmap function so it works on both platforms.
An alternative is maybe investigate if Java android allows you to pass a remote url to create a bitmap. The problem is to decide when is a remote image and when is a local one.
The iOS implementation allows the resolution of images from the web however the android implementation does not, should we update the android implementation to support both resolving images from the web?