debug: add explicit logging to show crop bounds and rotation values
This commit is contained in:
@@ -81,7 +81,9 @@ class ImageProcessor:
|
||||
# Open image with PIL (without applying EXIF yet, so crop_bounds match AI analysis)
|
||||
image = Image.open(io.BytesIO(file_bytes))
|
||||
original_size = image.size
|
||||
self.logger.info(f"[PROCESS] Input: {len(file_bytes)} bytes, size={original_size}, crop_bounds={crop_bounds}, rotation={rotation_degrees}°")
|
||||
msg = f"[PROCESS] Input: {len(file_bytes)} bytes, size={original_size}, crop_bounds={crop_bounds}, rotation={rotation_degrees}°"
|
||||
self.logger.info(msg)
|
||||
print(f">>> {msg}") # Explicit print for visibility
|
||||
|
||||
# Extract EXIF orientation (but don't apply yet)
|
||||
exif_orientation = self._extract_exif_orientation(image)
|
||||
@@ -100,11 +102,15 @@ class ImageProcessor:
|
||||
crop_bounds['x'] + crop_bounds['width'],
|
||||
crop_bounds['y'] + crop_bounds['height'],
|
||||
)
|
||||
self.logger.info(f"[CROP] Manual bounds: {crop_rect}")
|
||||
msg1 = f"[CROP] Manual bounds: {crop_rect}"
|
||||
self.logger.info(msg1)
|
||||
print(f">>> {msg1}") # Explicit print
|
||||
cropped_image = image.crop(crop_rect)
|
||||
crop_size = cropped_image.size
|
||||
crop_method = 'manual'
|
||||
self.logger.info(f"[CROP] Result size: {crop_size}, pixels={crop_size[0]*crop_size[1]}")
|
||||
msg2 = f"[CROP] Result size: {crop_size}, pixels={crop_size[0]*crop_size[1]}"
|
||||
self.logger.info(msg2)
|
||||
print(f">>> {msg2}") # Explicit print
|
||||
else:
|
||||
# Try OpenCV smart crop on raw image
|
||||
self.logger.info("[CROP] Attempting OpenCV smart crop...")
|
||||
|
||||
Reference in New Issue
Block a user