File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -80,6 +80,24 @@ <h2>Select an image file</h2>
8080 < input type ="url " id ="url " placeholder ="Image URL " />
8181 </ p >
8282 < p > Or < strong > drag & drop</ strong > an image file onto this webpage.</ p >
83+ < p >
84+ < label for ="orientation "> Orientation:</ label >
85+ < select id ="orientation ">
86+ < option value ="0 "> true: according to the EXIF orientation value</ option >
87+ < option value ="1 "> 1: top-left (original)</ option >
88+ < option value ="2 "> 2: top-right (horizontal flip)</ option >
89+ < option value ="3 "> 3: bottom-right (180° rotate left)</ option >
90+ < option value ="4 "> 4: bottom-left (vertical flip)</ option >
91+ < option value ="5 "
92+ > 5: left-top (vertical flip + 90° rotate right)</ option
93+ >
94+ < option value ="6 "> 6: right-top (90° rotate right)</ option >
95+ < option value ="7 "
96+ > 7: right-bottom (horizontal flip + 90° rotate right)</ option
97+ >
98+ < option value ="8 "> 8: left-bottom (90° rotate left)</ option >
99+ </ select >
100+ </ p >
83101 < h2 > Result</ h2 >
84102 < p id ="actions " style ="display: none; ">
85103 < button type ="button " id ="edit "> Edit</ button >
Original file line number Diff line number Diff line change @@ -141,7 +141,7 @@ $(function () {
141141 canvas : true ,
142142 pixelRatio : window . devicePixelRatio ,
143143 downsamplingRatio : 0.5 ,
144- orientation : true ,
144+ orientation : Number ( $ ( '#orientation' ) . val ( ) ) || true ,
145145 meta : true
146146 }
147147 exifNode . hide ( ) . find ( 'table' ) . remove ( )
@@ -206,6 +206,18 @@ $(function () {
206206
207207 $ ( '#url' ) . on ( 'change paste input' , urlChangeHandler )
208208
209+ $ ( '#orientation' ) . on ( 'change' , function ( ) {
210+ var img = result . find ( 'img, canvas' ) [ 0 ]
211+ if ( img ) {
212+ updateResults (
213+ loadImage . scale ( img , {
214+ pixelRatio : window . devicePixelRatio ,
215+ orientation : Number ( $ ( '#orientation' ) . val ( ) ) || true
216+ } )
217+ )
218+ }
219+ } )
220+
209221 $ ( '#edit' ) . on ( 'click' , function ( event ) {
210222 event . preventDefault ( )
211223 var imgNode = result . find ( 'img, canvas' )
You can’t perform that action at this time.
0 commit comments