fix: compute lossless_reconstruction when not present in options
Co-authored-by: aider (openrouter/anthropic/claude-sonnet-4) <aider@aider.chat>
This commit is contained in:
@@ -122,7 +122,17 @@ class PageContext:
|
||||
setattr(clean_options, key, value)
|
||||
except TypeError:
|
||||
continue
|
||||
clean_options.lossless_reconstruction = self.options.lossless_reconstruction
|
||||
# Set lossless_reconstruction if it exists, otherwise compute it
|
||||
if hasattr(self.options, 'lossless_reconstruction'):
|
||||
clean_options.lossless_reconstruction = self.options.lossless_reconstruction
|
||||
else:
|
||||
# Compute lossless_reconstruction for Namespace objects
|
||||
clean_options.lossless_reconstruction = not any([
|
||||
getattr(self.options, 'deskew', False),
|
||||
getattr(self.options, 'clean_final', False),
|
||||
getattr(self.options, 'force_ocr', False),
|
||||
getattr(self.options, 'remove_background', False),
|
||||
])
|
||||
state['options'] = clean_options
|
||||
|
||||
# Handle stream inputs
|
||||
|
||||
Reference in New Issue
Block a user