@@ -168,14 +168,51 @@ describe('Partial image extraction', function () {
168168 } ) ;
169169 } ) ;
170170
171- it ( 'Rotate with EXIF mirroring then extract' , function ( done ) {
172- sharp ( fixtures . inputJpgWithLandscapeExif7 )
173- . rotate ( )
174- . extract ( { left : 0 , top : 208 , width : 60 , height : 40 } )
175- . toBuffer ( function ( err , data ) {
176- if ( err ) throw err ;
177- fixtures . assertSimilar ( fixtures . expected ( 'rotate-mirror-extract.jpg' ) , data , done ) ;
171+ describe ( 'Apply exif orientation and mirroring then extract' , ( ) => {
172+ [
173+ {
174+ name : 'EXIF-1' ,
175+ image : fixtures . inputJpgWithLandscapeExif1
176+ } ,
177+ {
178+ name : 'EXIF-2' ,
179+ image : fixtures . inputJpgWithLandscapeExif2
180+ } ,
181+ {
182+ name : 'EXIF-3' ,
183+ image : fixtures . inputJpgWithLandscapeExif3
184+ } ,
185+ {
186+ name : 'EXIF-4' ,
187+ image : fixtures . inputJpgWithLandscapeExif4
188+ } ,
189+ {
190+ name : 'EXIF-5' ,
191+ image : fixtures . inputJpgWithLandscapeExif5
192+ } ,
193+ {
194+ name : 'EXIF-6' ,
195+ image : fixtures . inputJpgWithLandscapeExif6
196+ } ,
197+ {
198+ name : 'EXIF-7' ,
199+ image : fixtures . inputJpgWithLandscapeExif7
200+ } ,
201+ {
202+ name : 'EXIF-8' ,
203+ image : fixtures . inputJpgWithLandscapeExif8
204+ }
205+ ] . forEach ( ( { name, image } ) => {
206+ it ( name , function ( done ) {
207+ sharp ( image )
208+ . rotate ( )
209+ . extract ( { left : 0 , top : 208 , width : 60 , height : 40 } )
210+ . toBuffer ( function ( err , data ) {
211+ if ( err ) throw err ;
212+ fixtures . assertSimilar ( fixtures . expected ( 'rotate-mirror-extract.jpg' ) , data , done ) ;
213+ } ) ;
178214 } ) ;
215+ } ) ;
179216 } ) ;
180217
181218 describe ( 'Invalid parameters' , function ( ) {
0 commit comments