Skip to content

Commit

Permalink
appropriately apply rotation to uploaded images before conversion (#198)
Browse files Browse the repository at this point in the history
  • Loading branch information
cmintey authored Dec 20, 2024
1 parent c82533c commit fe02ade
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/lib/server/image-util.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ export const createImage = async (username: string, image: File): Promise<string
if (create_image) {
filename = username + "-" + Date.now().toString() + ".webp";
const ab = await image.arrayBuffer();
await sharp(ab).resize(300).webp().toFile(`uploads/${filename}`);
await sharp(ab).rotate().resize(300).webp().toFile(`uploads/${filename}`);
}

return filename;
Expand Down

0 comments on commit fe02ade

Please sign in to comment.