I am getting Image in response from restful API. Then i am converting it to base64 and displaying in a widget. now i want to hit the same image in the another API but this time I've to convert the image or base64 to Blob. Please do let me if you can help me on this.
Thank you.
Related
I am using power autoamte to convert an image in base64, and then I put this code in html.
Here is what I do:
I convert the original image to base64
I put this code in the html content in the <img src='myBase64'>
tag.
I convert the html to pdf format
Everything is fine, but when my html file reaches more than 2 mb my flow stops working. This is the limit for this conversion operation.
My question is:
Is it possible to resize the base64 code? I know there are external connectors resize images like Encodian, but I don't want to use them.
I searched on the internet, but without much results.
Thank you in advance
I'm trying to display an image stored as blob in flutter. I'm using a PHP API to get the image and send it as a base64 string. When the image builds, there is an error that says Failed decoding image. Data is either invalid, or it is encoded using an unsupported format.
Running an xampp server. PHP APIs. Flutter application run using android studio emulator
I am able to display the image on a webpage using a HTML img tag.
Image.memory(base64Decode(imagebase64string));
I expect the image to be shown on the screen
Error says
Failed decoding image. Data is either invalid, or it is encoded using an unsupported format.
You have to remove base64 header manualy:
final stripped =
imagebase64string.replaceFirst(RegExp(r'data:image/[^;]+;base64,'), '');
setState((){
data = base64.decode(stripped);
});
Then you can use data with Image.memory.
Image.memory(data)
Decode it back to a byte array from base64 and use this from dart.ui:
final codec = await ui.instantiateImageCodec(data);
final frame = await codec.getNextFrame();
return frame.image;
Or even simpler, from package:flutter/widgets.dart:
return decodeImageFromList(data);
I am converting PDF to image using GhostScript. The problem i am facing is when pdf has links then i need to have those clickable links in converted image as well. How could i achieve this.
How do you expect an image format to have 'clickable links' ? What image format do you think has the ability to click on links ?
I'm pulling from an API that gives me back an image in a blob inside the response. I need to display this image somewhere. I tried using react-native-fetch-blob, but its clear that that's a complete mess. I'm guessing there has to be some way I can convert it to base64 so that the image can be displayed.
I want to retrieve metadata (width, hight, format ..) from image file (jpeg, png, bmp etc.) in the Html5.
I can use Canvas Api to deal width image.
However, I cannot find Api to retrieve metadata from a file.
Does anyone can know me?
It looks like this little lib might do the trick for you.