File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -13,7 +13,7 @@ <h2 class="title has-text-centered" id="title" href="#confidenceLevel">NFT Marke
1313 < button class ="button is-fullwidth " id ="generateBt " onclick ="window.generate() " disabled > Generate</ button >
1414 </ div >
1515 < div class ="tile is-ancestor " id ="wrapper ">
16- < canvas class ="tile " id ="imageCanvas " style =" width: auto; height: 120rem " > </ canvas >
16+ < canvas class ="tile " id ="imageCanvas " > </ canvas >
1717 < div class ="spinner-container ">
1818 < div class ="spinner "> </ div >
1919 </ div >
Original file line number Diff line number Diff line change @@ -208,11 +208,14 @@ function useJpeg(e) {
208208function readImage ( e ) {
209209 reader . onload = function ( event ) {
210210
211- var img = new Image ( ) ;
211+ const img = new Image ( ) ;
212212 img . onload = function ( ) {
213- var canvasEl = document . querySelector ( '#imageCanvas' ) ;
214- canvas . width = canvasEl . clientWidth ;
215- canvas . height = canvasEl . clientHeight ;
213+ canvas . width = img . width ;
214+ canvas . height = img . height ;
215+
216+ canvas . style . width = img . width > 1200 ? '1200px' : img . width + 'px' ;
217+ canvas . style . height = img . height > 1200 ? '1200px' : img . height + 'px' ;
218+
216219
217220 hideCanvas . width = img . width ;
218221 hideCanvas . height = img . height ;
You can’t perform that action at this time.
0 commit comments