From fe5193a20bef13103b6c26819041994c180443ef Mon Sep 17 00:00:00 2001 From: Patrick Fic Date: Tue, 14 Jan 2020 22:51:08 -0800 Subject: [PATCH] WIP Image Processing --- .../jobs-documents/jobs-documents.page.jsx | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/client/src/pages/jobs-documents/jobs-documents.page.jsx b/client/src/pages/jobs-documents/jobs-documents.page.jsx index 95d7269a5..da1c68a83 100644 --- a/client/src/pages/jobs-documents/jobs-documents.page.jsx +++ b/client/src/pages/jobs-documents/jobs-documents.page.jsx @@ -68,7 +68,6 @@ function JobsDetailPage({ match, loading, data }) { }); const test = props => { - // axios.get("http://localhost:5000/test").then(r => console.log("r", r)); axios({ url: "/test", method: "get" @@ -151,10 +150,20 @@ function JobsDetailPage({ match, loading, data }) { ); - const transformFile = props => { - console.log("Transforming file.", props); - //Make the image smaller here. - return props; + const transformFile = file => { + console.log("Transforming file.", file); + // Make the image smaller here. + + const reader = new FileReader(); + + reader.onload = e => { + console.log(e.target.result); + }; + reader.readAsDataURL(file); + + console.log("reader", reader); + + return file; }; return (