Skip to content

Commit

Permalink
WIP: Do not remove orientation EXIF markers
Browse files Browse the repository at this point in the history
  • Loading branch information
ekzyis committed Dec 11, 2023
1 parent 44ad127 commit 21a9c3e
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion components/image.js
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,9 @@ const removeExifData = (file) => {
const exifMarker = 0xffe1
let offset = 2 // Skip the first two bytes (0xFFD8)
while (offset < dataView.byteLength) {
if (dataView.getUint16(offset) === exifMarker) {
const tag = dataView.getUint16(offset)
const isOrientationMarker = tag === 0x0112
if (tag === exifMarker && !isOrientationMarker) {
// Found an EXIF marker
const segmentLength = dataView.getUint16(offset + 2, false) + 2
arrayBuffer = removeSegment(arrayBuffer, offset, segmentLength)
Expand Down

0 comments on commit 21a9c3e

Please sign in to comment.