fix(docparser): preserve standalone image uploads from icon filter
When the uploaded file is itself an image, the image reference now carries an IsOriginal flag so ResolveAndStore skips the small-icon size filter. Otherwise small standalone images (e.g. avatars below 64x64) were silently dropped before reaching multimodal OCR/caption processing.
This commit is contained in:
@@ -126,8 +126,11 @@ func (r *ImageResolver) ResolveAndStore(
|
||||
continue
|
||||
}
|
||||
|
||||
// Filter out small icons and decorative images
|
||||
if isIconImage(ref.ImageData) {
|
||||
// Filter out small icons and decorative images. Skip the filter
|
||||
// when the reference is the originally uploaded file itself, so
|
||||
// that a standalone image upload is never silently dropped even
|
||||
// if its dimensions are below the icon threshold.
|
||||
if !ref.IsOriginal && isIconImage(ref.ImageData) {
|
||||
// Remove the image reference from markdown entirely
|
||||
markdown = markdown[:m[0]] + markdown[m[1]:]
|
||||
continue
|
||||
|
||||
Reference in New Issue
Block a user