Urgent.News

What's breaking now, across hundreds of outlets.

Tech

Your Downloaded Images Are Sideways: Parsing EXIF Orientation in JPEG, WebP and AVIF

Every image collector eventually ships a bug report that reads like this: "the images I downloaded are rotated 90 degrees." And every developer answers it once with "that's just how the camera saved it", and then spends three hours discovering that it is not that simple. The pixels on disk are not rotated. The file declares a rotation. Two different consumers — your browser, your image viewer,…

When you download an image from your phone, it is not unusual to find that it appears sideways. This is because the camera records the image in a landscape orientation, but the photographer may have intended for it to be displayed in portrait mode. The EXIF orientation field in the image file declares how the viewer should rotate the image.

However, different consumers such as browsers, image viewers, and design tools may disagree about whether to apply this declaration, leading to inconsistent results. The EXIF orientation field is located in the JPEG file as a two-byte value, while in WebP and AVIF, it is represented differently. Browsers automatically apply the orientation transformation when an image is displayed, which can lead to double-rotated images if a separate rotation is applied afterwards.

Therefore, it is important to understand where the EXIF orientation field lives in different file formats and how browsers handle it to avoid producing distorted images in production.

Rewritten by urgent.news; may contain errors — check the original.

Source: dev.to

Read the original at dev.to →

Report a problem with this story

More in Tech

WP Media Folder blind SQL injection starts with low privilege

WP Media Folder blind SQL injection starts with low privilege CVE-2026-131701 affects WP Media Folder through version 6.2.8 and is fixed in 6.3.0.

  • Blind SQL injection vulnerability in WP Media Folder plugin version 6.2.8 or earlier
  • Users with low privilege levels can exploit the vulnerability to access sensitive data
  • Issue resolved in version 6.3.0, but site admins should perform security checks

More from Tuesday 24 November →