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.
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 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.
I haven't dive in to trying the library out because I am trying to find out if this is possible.
I want to have the client side create a thumbnail as well as optimize the orignal file for web use. So upload maybe a 30x30 or 50x50 thumbnail and then a full size image like 600x600 or 800x800 With the same post request. Then I will be able to provide the serve the photos directly from what was uploaded.
If this is possible, what would the thumbnail be, post file[1] and full image, size file[0]
Is it possible to set it up to allow multiple post request for multiple images where each request has both a thumbnail and a full size image?
Is not a built in feature in dropzone but it is possible, but I think the easiest approach using dropzone would be to send the full image as a file, and the thumbnail as a text input field with the thumbnail base 64 encoded.
And yes you can configure dropzone to send an independent request for every image with one of this pairs per request.
I'm wondering if anyone knows a good strategy for solving this problem:
I'm creating a social networking site using Laravel 4. Users can upload pictures to their own gallery. These pictures can be any shape and size but the gallery on their profile will only display a cropped and resized thumbnail of the image (200px x 200px), which you can click on to view the full image.
Im using the Laravel plugin Intervention right now, which saves the original image, then resizes and crops that image and saves it again ( so now I have 2 copies). I then display the cropped/resized image as the thumbnail that links to the full size original image. However, I find that making copies of every image will be a tedious waste of space on my server since there could be thousands of images uploaded to the site.
Is there a way to grab the original image, resize and crop it on the fly and display it only when the user loads the page without having to save the thumbnail to the server? or am I stuck with having to make a cropped copy for every image?
A great example that shows what I'm looking to achieve is the way Facebook crops pictures into squares in a users picture gallery or how they are cropped and resized on the newsfeed when a user uploads multiple images to a status.
Any advice is greatly appreciated!
Have you seen League/Glide yet? It's basically a wrapper for Intervention/Image and Intervention/ImageCache. Glide's Laravel setup video gets you set up in two minutes (pay attention to the second example).
Yes Intervention let's you manipulate and display on the fly too.
Here's a simple example (obviously you would actually do it with a controller etc)
Route::get('img/profile/picture.jpg', function(){
$img = Image::make('path/to/profile/picture.jpg');
// resize, crop, whatever
return $img->response();
});
And then you just set the right URI to this route as src of your image.
Intervention Docs
Keep in mind that this will use more server resources and make the image response take longer
I have an image encoded in base64 and in an HTML page.
Example:
<img src="data:image/jpeg;base64,/9j/4S/+...">
Simple question:
Is the above code cached or is it loaded every time the page loads? I find conflicting answers when I research the topic.
By "the above code cached" you mean if the image is decoded each time or if the browser keeps a decoded image cache in memory? If so, to me the answer is no, it won't keep the decoded image, only the data to decode the image again (the whole HTML in this case). Maybe I'm wrong, but that's what I will expect.