fix: CRITICAL - remove double rotation (frontend + backend)

Root cause: Image was being rotated TWICE:
1. Frontend rotated it in the modal and sent processed blob
2. Backend rotated it AGAIN based on rotation_degrees

This double rotation made the image appear unrotated or distorted.

Solution: Remove frontend image processing entirely.
- Modal now sends ONLY the rotation value
- No imageBlob from modal (uses original)
- Backend receives original image + rotation value
- Backend applies rotation ONCE

Now image is rotated correctly by backend without duplication.

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
This commit is contained in:
2026-04-22 14:23:20 +03:00
parent 743f377357
commit 285c3f17d4
3 changed files with 18 additions and 51 deletions

View File

@@ -96,9 +96,12 @@ export default function AIOnboarding({ onCancel, onComplete, categories, invento
// CRITICAL: Update state AND processed blob BEFORE calling hook
setExtractedItems(updatedItems);
// DON'T replace image blob - modal no longer processes image
// Backend will apply rotation to original image
if (adjustments.imageBlob) {
console.log('[Update] Setting extractedImageBlob to processed blob:', adjustments.imageBlob.size, 'bytes');
setExtractedImageBlob(adjustments.imageBlob);
console.log('[Update] Processed blob received but NOT using (backend will process)');
} else {
console.log('[Update] No imageBlob - using original, backend will apply rotation');
}
// CRITICAL: Call hook with UPDATED item, not old one