Bhuvi13 commited on
Commit
4bd0d3a
·
verified ·
1 Parent(s): 38aa4f9

Update src/streamlit_app.py

Browse files
Files changed (1) hide show
  1. src/streamlit_app.py +2 -2
src/streamlit_app.py CHANGED
@@ -187,7 +187,7 @@ def perform_ocr(image, bbox):
187
  except Exception as e:
188
  return f"OCR Error: {str(e)}"
189
 
190
- def scale_image_to_fixed_size(image, max_width=1300, max_height=1100):
191
  """Scale image to fit within max dimensions while maintaining aspect ratio - NO PADDING"""
192
  if image.mode not in ('RGB', 'RGBA'):
193
  image = image.convert('RGB')
@@ -849,7 +849,7 @@ elif st.session_state.page == 'viewer':
849
  current_image = None
850
 
851
  if current_image:
852
- scaled_image, scale_ratio, paste_x, paste_y = scale_image_to_fixed_size(current_image, max_width=900, max_height=1100)
853
 
854
  # Wrap canvas in scrollable container
855
  st.markdown(f'<div class="image-scroll-container" style="max-height: {scaled_image.height + 40}px;">', unsafe_allow_html=True)
 
187
  except Exception as e:
188
  return f"OCR Error: {str(e)}"
189
 
190
+ def scale_image_to_fixed_size(image, max_width=1100, max_height=1100):
191
  """Scale image to fit within max dimensions while maintaining aspect ratio - NO PADDING"""
192
  if image.mode not in ('RGB', 'RGBA'):
193
  image = image.convert('RGB')
 
849
  current_image = None
850
 
851
  if current_image:
852
+ scaled_image, scale_ratio, paste_x, paste_y = scale_image_to_fixed_size(current_image, max_width=800, max_height=1100)
853
 
854
  # Wrap canvas in scrollable container
855
  st.markdown(f'<div class="image-scroll-container" style="max-height: {scaled_image.height + 40}px;">', unsafe_allow_html=True)