How to display Base64 image on browser - javascript

import React from "react";
import _ from "lodash";
export default function AllPhotos(props) {
let arrOfPhoto = _.forEach(props.photo, function(url) {
//console.log("my", url); => I get this "data:image/jpg;base64,/9j/4AAQSkZJRgABAQAAAQABAAD/2wCEAAkGBxMTEhUSExMVFRUXGBcZGBgXFRcVFRUVFxUYFxYVFRUYHSggGBolGxUVITEhJSkrLi4uFx8zODMtNygtLisBCgoKDg0OGxAQGi0lICUtLS0tLS0tLS0rLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLf/AABEIAOEA4QMBIgACEQEDEQH/xAAbAAACAwEBAQAAAAAAAAAAAAADBAACBQEGB//EADwQAAEDAgQEBAQFBAAFBQAAAAEAAhEDIQQSMUEFUWFxEyKBkQahsfAUMsHR4SNCUvEVM3KSogdTYoKT/8QAGQEAAwEBAQAAAAAAAAAAAAAAAAECAwQF/8QAJREAAgICAgICAwADAAAAAAAAAAECERIhAzFBURMiBDJhQnHw/9oADAMBAAIRAxEAPwD6eCrAoMojSqA7KhK5mVXFABGlWlCYURAzj3WWNhKv9UrVquWDhh/WJ6oAc+JXeReEz2K9r8SO/pnsvnXjXKymjSAUVLovjws8vuu1XGFmaoarYhKuvdKVKitQcSFajRGRu8FaLo2OYk+DOuU1jnpLsvwJ4YwVtNIhYNN10/SqlYzWzr4n9RyobJYlXe6yXLkihsOQqxUlUqFAgbSl6pujpeoUAVDrpl2iVbqmKhTAfw2yecbhZuGOi0P7h2TJZaVFxRMVntSugobXKxK6zzDq4SoFV6ALsKuSgMVy5AzlYrJw7fOe606zrFecq47K4pDG/iR/kPZfOXnzFeo41ji8QvPMpRJKmSs0joAxirWqWRn1BCTLxB7rJLZdlHMklGpQGhCbV8x7KOdZa0RY7w6pDimMVWWbgn+Yo2Iq2Ullqb7rQouWNRqXWnQcsJ9nVx9D73WQJVnmyDmUmg4SqVDZcLlSo+yBFSUrVcjZkvXQMlN1wmquiSpapyoZCAHMLsnQ7zBJYY2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ibG21up5pttSCSDc676rMY4ESEzRdpOoUpPyCY4Ksx9hAZ+aZOum0JbMZkaBc/EXnRTjLsdm48hu8TZGxeFORpghpETrfaR7rGbiMzom1rrZxOIbkAYTAG+53WnEvrbNIvyZzpbY6adBuPVSkH6tEgH5Qj18V5cmUFwMz32QsLX0tueyqqditeyvh5mlsxbTYGdCjUsO1jZJm3t/ku5+Wh1RMbiAIj8oERzKafodrs74qiHB6KJ2ys2eTpyJHzVqZIMk2RA9sEmxS1YF2mibOMbFYTZQOzWSow5FhqdEyGQ0ROebpP+FJsbmw9lKjQ0jrdKB5m/spUebSoeyrHaD2i6HUAs6IKDmnRdZUzCNwkw2EO/VTNNomF0GQqsIBtZGI1YV7xAhSmZ1CTl2ayua/JNJMQw3pzQ3DzXVMO43GpTTNLmCqqgQoaEuB1ui1QHG1kSmyN1eqBqFTehvoTqQ081VpBtuiOpNkk2VZaDI1U42CK06JbBH8JqmTqeS4yr5YsisaT2Q0DVCtIm/Urrmy8BFY65AGiYpOaCHObcJbbElYtTwhYTvf2TYq80Wri50CV/EDQhD10PoYwx8pkKzDtoqeNYQuVKgUp3sEFYRzV8VJG0BItbKKQ4GNlaK8FMz/8AIqIsKIpiPO1NQjM1XVFU/wBTE7Q/5gT4191FFPotCVf/AJn3zUrflUUU/wCQ2GoflQMPuoonPsY7R3S4/VdUS9DCP0KVqaLiiF0R4CcL/MmcT+b3UUV+A8HG6n73RHalRRIBZ+qFW2UUVoaLDT1T+EXVFMuykcpfnTOM/KoomAqNUviNVFFDIYWpsrvUUS8FeA1PT1RnLqiovwKKKKKjM//Z"
return <img src={url} className="singlePhoto" />;
});
return (
<div className="allPhotos">
{arrOfPhoto}
</div>
);
}
I'm trying to display images on my browser by using Base64 and react. What I want to do here is put base64 string(url) into src of img tag. If I copy and paste the base64 string, "data:image...", to a search bar of google chrome, I get a picture of a dog, however, if I put {arrOfPhoto} on my file, it doesn't show an image on the browser, but instead, it shows literally "data:image/...". I guess I'm not able to put the base64 data into src attribute of img tag correctly, but can you see what I'm doing wrong and how to fix it?

You are doing great, also you have structured your AllPhotos React functional component very well, just use it, I have tried and tested it.
AllPhotos.js
import React from 'react';
const AllPhotos = (props) => {
const url1 = "data:image/jpg;base64,/9j/4AAQSkZJRgABAQAAAQABAAD/2wCEAAkGBxMTEhUSExMVFRUXGBcZGBgXFRcVFRUVFxUYFxYVFRUYHSggGBolGxUVITEhJSkrLi4uFx8zODMtNygtLisBCgoKDg0OGxAQGi0lICUtLS0tLS0tLS0rLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLf/AABEIAOEA4QMBIgACEQEDEQH/xAAbAAACAwEBAQAAAAAAAAAAAAADBAACBQEGB//EADwQAAEDAgQEBAQFBAAFBQAAAAEAAhEDIQQSMUEFUWFxEyKBkQahsfAUMsHR4SNCUvEVM3KSogdTYoKT/8QAGQEAAwEBAQAAAAAAAAAAAAAAAAECAwQF/8QAJREAAgICAgICAwADAAAAAAAAAAECERIhAzFBURMiBDJhQnHw/9oADAMBAAIRAxEAPwD6eCrAoMojSqA7KhK5mVXFABGlWlCYURAzj3WWNhKv9UrVquWDhh/WJ6oAc+JXeReEz2K9r8SO/pnsvnXjXKymjSAUVLovjws8vuu1XGFmaoarYhKuvdKVKitQcSFajRGRu8FaLo2OYk+DOuU1jnpLsvwJ4YwVtNIhYNN10/SqlYzWzr4n9RyobJYlXe6yXLkihsOQqxUlUqFAgbSl6pujpeoUAVDrpl2iVbqmKhTAfw2yecbhZuGOi0P7h2TJZaVFxRMVntSugobXKxK6zzDq4SoFV6ALsKuSgMVy5AzlYrJw7fOe606zrFecq47K4pDG/iR/kPZfOXnzFeo41ji8QvPMpRJKmSs0joAxirWqWRn1BCTLxB7rJLZdlHMklGpQGhCbV8x7KOdZa0RY7w6pDimMVWWbgn+Yo2Iq2Ullqb7rQouWNRqXWnQcsJ9nVx9D73WQJVnmyDmUmg4SqVDZcLlSo+yBFSUrVcjZkvXQMlN1wmquiSpapy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Sow5FhqdEyGQ0ROebpP+FJsbmw9lKjQ0jrdKB5m/spUebSoeyrHaD2i6HUAs6IKDmnRdZUzCNwkw2EO/VTNNomF0GQqsIBtZGI1YV7xAhSmZ1CTl2ayua/JNJMQw3pzQ3DzXVMO43GpTTNLmCqqgQoaEuB1ui1QHG1kSmyN1eqBqFTehvoTqQ081VpBtuiOpNkk2VZaDI1U42CK06JbBH8JqmTqeS4yr5YsisaT2Q0DVCtIm/Urrmy8BFY65AGiYpOaCHObcJbbElYtTwhYTvf2TYq80Wri50CV/EDQhD10PoYwx8pkKzDtoqeNYQuVKgUp3sEFYRzV8VJG0BItbKKQ4GNlaK8FMz/8AIqIsKIpiPO1NQjM1XVFU/wBTE7Q/5gT4191FFPotCVf/AJn3zUrflUUU/wCQ2GoflQMPuoonPsY7R3S4/VdUS9DCP0KVqaLiiF0R4CcL/MmcT+b3UUV+A8HG6n73RHalRRIBZ+qFW2UUVoaLDT1T+EXVFMuykcpfnTOM/KoomAqNUviNVFFDIYWpsrvUUS8FeA1PT1RnLqiovwKKKKKjM//Z";
const urls = [url1, url2]; // your array of photo urls, which you'll get by props
const images = urls.map((url,index) => (<img key={index} src={url} className='singlePhoto' />));
return (
<div>
{images}
</div>
);
}
export default AllPhotos;

You can just stick it in an image tag.
<img src="data:image/png;base64, [base64 encoded image string here]">

Related

Check the url path is valid in react

this is the dynamic url
../Assets/${product.code}/${image1}.png
Some product have images and some does not have one. Therefore if the URL is not valid, I want to return different JSX element. Is there any way to check the validity of the image URL path ?
You can do by try/catch if an error then returns a different JSX element.
setProductImageSrc() {
try{
const src = require(`../Assets/${product.code}/${image1}.png`)
this.setState({ src });
}
catch(err){
//Do whatever you want when the image failed to load here show return different JSX element
}
}
Solution
There is an attribute on the image tag called onError, which can triggered a function when the image fails to load. So what you can do is when image fails to load either put different image i.e default image or different JSX element as your wish.
Example:
import {useState} from "react"
function App() {
const[iserror,Setiserror]=useState(false)
const errorFunc =()=>{
Setiserror(true)
}
return (
<div>
{!iserror?<img onError={errorFunc} src="noimageurl" alt=""/>
:<div>This will show when image fails to load</div>
</div>
);
}
use fetch
const url="your-url-here"
fetch(url)
.then(res=>{
// valid image
})
.catch(error => {
// Image not found, Handle it here
}

draft-js-link-detection-plugin save to html with link?

So, what I'm trying to do is use this draftjs plugin to save text already formatted as HTML so I can insert it as HTML in my div to have clickable links, I already saw these examples and guides and tried to follow them, but I can't figure out what I'm doing wrong, examples and documentation used:
oficial documentation for plugin
Code sandBox with code example
-> These two I think were the really helpful ones and my base to write my code:
example of front with working implementation
The code behind that implementation
OBS: the problem is they don't really show how they save the formatted HTML state to pass in the div
After reading the documentation I coded this (dummies for show):
Some background to understand the code below
contentPost // useState passed in the <Editor>
const [contentPost, setContentPost] = useState(EditorState.createEmpty())
The component USAGE
<TextEditor
editorState={contentPost}
setEditorState={setContentPost}
hasError={hasError}
/>
component DEFINITION
function TextEditor({
editorState,
setEditorState
}: {
editorState: any
setEditorState: any
}) {
const linkifyPlugin = createLinkifyPlugin()
const plugins = [linkifyPlugin]
return (
<div>
<Editor
plugins={plugins}
editorState={editorState}
onEditorStateChange={setEditorState}
/>
</div>
)
}
How I save the values:
const payload = {
content: contentPost.getCurrentContent().getPlainText(),
contentFormatted: contentHtml,
}
handleCreatePost({ ...payload })
How I make the variable in which I save the HTML
const contentHtml = React.useMemo(() => {
const currentContent = contentPost.getCurrentContent()
return stateToHTML(currentContent)
}, [contentPost])
Any help would be appreciated!

React img onError not firing

I am trying to use a third-party API for getting YouTube thumbnails with higher resolution, which sometimes fails with code 404. If I fail to fetch the image, I would like to replace the src with the default YouTube thumbnail retrieved using its own API (I have the url stored in a json). When I tried to implement this using the img onError event, it appears that nothing is fired when the fetch fails. Does anybody know what's going on? Thanks!
const TestView = () => {
const videoId = "tuZty35Fk7M"
return (
<div>
<img src={`https://img.youtube.com/vi/${videoId}/maxresdefault.jpg`} onError={() => {console.log("errored")}}></img>
</div>
)
}
Update:
This ended up working pretty well
const TestView = () => {
const videoId = "tuZty35Fk7M"
const imgRef = useRef(null)
const [thumbnailSrc, setThumbnailSrc] = useState(`https://img.youtube.com/vi/${videoId}/maxresdefault.jpg`)
const defaultThumbnailSrc = `https://i.ytimg.com/vi/${videoId}/hqdefault.jpg`
const handleImgValidity = () => {
if (imgRef.current.naturalHeight == 90) {
setThumbnailSrc(defaultThumbnailSrc)
}
}
return (
<div>
<img ref={imgRef} src={thumbnailSrc} onLoad={handleImgValidity}></img>
</div>
)
}
It's nothing to do with React. Try visiting that url in your browser with a random string for the videoId. It will still display an image - in this case the default youtube thumbnail. So even though it's technically a 404, and your browser will report it as such, the image still has something to display so it won't fire the onError function.
If you replace the url in your code with something that is definitely a 404, your code works fine. Run the snippet below where i've swapped out youtube for google and you'll see your error message.
function onError() {
console.log('errored')
}
<img src="https://img.google.com/vi/some-random-id/maxresdefault.jpg" onError="onError()" />
Here is the working example of firing onError function.
https://codesandbox.io/s/reactjs-onerror-f7dq77

How can I draw or insert a shape into a PDF in React?

I'm working on a project that lets the user sign a pdf using React. Right now I'm displaying the pdf on an Iframe component and would like to let the user place a rectangle on the pdf that shows where would he want the sign to be displayed.
Is there any way for me to let the user "draw" that rectangle in the displayed pdf?
Right now my component looks like this:
import { PDFDocument } from "pdf-lib";
// import useffect
import { useState, useEffect } from "react";
const PDFRenderer = (props) => {
const { data } = props;
const [docurl, pdfBytes] = data;
const [sizes, setSizes] = useState(null);
useEffect(() => {
async function getSizes() {
const pdfDoc = await PDFDocument.load(pdfBytes);
const pages = pdfDoc.getPages();
const page = pages[0];
const { width, height } = page.getSize();
setSizes([width, height]);
}
getSizes();
}, [pdfBytes]);
return (
<div className="renderer">
{sizes && (
<iframe
src={docurl + "#zoom=100"}
width={sizes[0] * 1.5}
height={sizes[1]}
/>
)}
</div>
);
};
Its not a problem ask them to add the comments in their PDF, then send a copy of the printed pdf. Since the Iframe and its contents belong to the client, only they can tell you if the PDF was displayed in the IFrame or downloaded into an external application.
Thus you have no means other than politely request they upload a reproduction for you to copy the relative page location. If you want better control, perhaps you need an application/pdf such as Adobe produce.

Can't use require() method that receives a prop in React

As part of a personal project, I have to create an image gallery. For every image (miniature) that is clicked in the gallery, I want the chosen image to appear in a larger size on the page. I have been trying to do this by passing the desired image's address as a prop to my ImageOnView component, like so:
<ImageOnView imgSrc = {this.state.imageLarge}/>
Inside my ImageOnView component, however, I'm having trouble displaying the image using the require() method. Right now it looks like this:
class ImageOnView extends Component {
render() {
//This alert displays the image source as expected
alert(this.props.imgSrc);
return (
<img id = "image-large" src = {require(this.props.imgSrc)}/>
);
}
}
I get the following error on my webpage: "Error: Cannot find module ".""
How do I go about resolving this issue? Thanks in advance.
Just try
src={require('' + this.props.imgSrc)}
Since you are using Webpack as a bundler in runtime, require can't use a variable name like this. It should accept a resolvable path, ie a string here. So, you can require the image in the parent instead of the child and use the resolved path:
class App extends Component {
state = {
imageLarge: require( "./somedir/some.jpg" ),
};
render() {
return (
<div>
<ImageOnView imgSrc={this.state.imageLarge} />
</div>
);
}
}
class ImageOnView extends React.Component {
render() {
// This alert displays the image source as expected
alert( this.props.imgSrc );
return (
<img id="image-large" src={this.props.imgSrc} />
);
}
}
Can also do like this:-
import React from 'react';
function index({title, image, rating}) {
return <div>
<img alt="img" src={require("" + image)}></img>
</div>;
}
export default index;
require() is used to import a module or file. So to get an imageLarge from another file you might want to
const imageLarge = require(path)
or es6 version:
import imageLarge from 'path'
in the img tag you just need to provide a src attribute with imageLarge in component it would look something like:
const imageLarge = require(path)
<ImageOnView imgSrc = {imageLarge}/>
class ImageOnView extends Component {
render() {
return (
<img id = "image-large" src = {this.props.imgSrc}/>
);
}
}

Categories

Resources