fix(coding-agent): Fix EXIF orientation for JPEG and WebP images (#2105)

* fix(coding-agent): apply EXIF orientation correction during image convert and resize

* docs(coding-agent): add PR reference to changelog entry
This commit is contained in:
Melih Mucuk
2026-03-13 19:44:14 +03:00
committed by GitHub
parent bd2c3ab67e
commit 738319e465
4 changed files with 193 additions and 2 deletions

View File

@@ -1,3 +1,4 @@
import { applyExifOrientation } from "./exif-orientation.js";
import { loadPhoton } from "./photon.js";
/**
@@ -21,7 +22,9 @@ export async function convertToPng(
try {
const bytes = new Uint8Array(Buffer.from(base64Data, "base64"));
const image = photon.PhotonImage.new_from_byteslice(bytes);
const rawImage = photon.PhotonImage.new_from_byteslice(bytes);
const image = applyExifOrientation(photon, rawImage, bytes);
if (image !== rawImage) rawImage.free();
try {
const pngBuffer = image.get_bytes();
return {