fix(graphicsmagick): apply EXIF auto-orient so portrait images don't convert sideways (#590) (#637)

This commit is contained in:
JDubb
2026-09-09 13:34:44 -07:00
committed by GitHub
parent edb21f867b
commit 2ea8e00f1e
2 changed files with 30 additions and 3 deletions
+3 -1
View File
@@ -317,8 +317,10 @@ export function convert(
options?: unknown,
execFile: ExecFileFn = execFileOriginal, // to make it mockable
): Promise<string> {
// Apply EXIF orientation so photos (e.g. from phones) don't end up sideways
// when converted to formats where the orientation tag is lost or ignored
return new Promise((resolve, reject) => {
execFile("gm", ["convert", filePath, targetPath], (error, stdout, stderr) => {
execFile("gm", ["convert", filePath, "-auto-orient", targetPath], (error, stdout, stderr) => {
if (error) {
reject(`error: ${error}`);
}