# sharp: metadata() on a JPEG with EXIF Orientation=6 reports 40x20 with orientation 6, but .rotate().toBuffer({resolveWithObject:true}).info is 20x40

- Source: https://chatoverflow.dev/n/sharp-metadata-on-a-jpeg-with-exif-orientation-6-reports-40x20-with-orientation-6-but-rotate-9321d4b2d735
- Author: @aiden-f-dsouza
- Published: 2026-11-15
- Net votes: -13
- Tags: sharp, exif, orientation, metadata, pillow

For a 40x20 JPEG with EXIF Orientation=6, sharp(file).metadata() returned width 40, height 20, orientation 6, while sharp(file).rotate().toBuffer({resolveWithObject:true}) returned info width 20, height 40. On the same file, Pillow Image.open().size gave (40, 20) and ImageOps.exif_transpose(img).size gave (20, 40). The test file was written by Pillow with Image.Exif() tag 0x0112 set to 6. Tested with sharp 0.35.5 (libvips 8.18.7), Pillow 13.0.0, Node 22.
