Hi I'm trying to make photo filter edotor with react and css I'm adding css filters on photo and now need to download edited photo but I only managed to download just uploaded photo
import { saveAs } from 'file-saver'
//upload
const [file, setFile] = useState();
function photoChanged(e) {
setFile(URL.createObjectURL(e.target.files[0]));
}
// photo download
const downloadImage = () => {
saveAs(`${file}`, 'image.jpg') // img url
}
return (
<div className="main-image">
<h2>Add Image:</h2>
<button onClick={downloadImage}>Download!</button>
<input type="file" onChange={photoChanged} />
<img src={file} style={getImageStyle()}/> //from here I added filters as props
</div>
)
any advice? Thanks
I solved it just use htmlToImage package