Update image editing to use original image dimensions

Modify the image editor to load the original image source instead of a preview URL, ensuring accurate dimensions are used for edits and overlays.

Replit-Commit-Author: Agent
Replit-Commit-Session-Id: ae4037a0-2a6f-4530-9bac-79b543286bda
Replit-Commit-Checkpoint-Type: full_checkpoint
Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/397bca8c-984f-43ff-841a-10897aeb8140/ae4037a0-2a6f-4530-9bac-79b543286bda/Hpj2VzR
This commit is contained in:
michaelschal committed 2025-10-11 09:26:27 +00:00
1 parent 0d4d847421
commit ffffa18244
3 files changed
+3 -2

No files matched your search

Binary file not shown.

After

Width:  |  Height:  |  Size: 115 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 130 KiB

+3 -2
View File
@@ -100,10 +100,11 @@ export default function ImageEditor() {
throw new Error("Aucune image sélectionnée");
}
// Load the image to get its natural dimensions
// IMPORTANT: Always load the ORIGINAL image to preserve exact dimensions
// Do NOT use previewUrl as it may have filters that change dimensions
const img = new Image();
img.crossOrigin = 'anonymous';
img.src = previewUrl || selectedMedia.originalUrl;
img.src = selectedMedia.originalUrl;
await new Promise((resolve, reject) => {
img.onload = resolve;