Skip to content

838 warining min count images in report - #869

Open
goormany wants to merge 10 commits into
devfrom
838_warining_min_count_images_in_report
Open

goormany wants to merge 10 commits into
devfrom
838_warining_min_count_images_in_report

Conversation

@goormany

Copy link
Copy Markdown
Collaborator

No description provided.

@HadronCollider
HadronCollider force-pushed the 838_warining_min_count_images_in_report branch from c703b04 to a1a9c07 Compare October 17, 2026 23:00

@HadronCollider HadronCollider left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. не нужно создавать новый критерий при наличии существующего (который уже считает кол-во рисунков) - это указано в задаче
  2. см. ниже

Comment on lines +15 to +16
if self.file.page_counter() < 4:
return answer(False, "В отчете недостаточно страниц. Нечего проверять.")

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

замените на новый метод if not self.has_enough_pages(): - md почти никогда не будет содержать больше 4х страниц

Comment on lines +55 to +57
if image[1]:
continue
image_xrefs.add(image[0])

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

не совсем понятная логика - о чем сигнализирует image[1] != 0?
для pdf с png с прозрачностью метод работает некорректно, поэтому кажется не стоит отбрасывать изображение из-за наличия маски

from tests.util import create_report_file_info


class TestMinCountImageReportChecker:

@HadronCollider HadronCollider Oct 17, 2026 •

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Тестируйте PDF-метод без мока - нам нужно проверить как он работает с разными PDF (а не то как критерий будет отвечать на заготовленные ответы): альфа-канал, повтор одного xref, несколько размещений, неиспользуемые ресурсы, изображения в приложении

Плюс проверьте, считаются ли векторные схемы рисунками (текущий метод учитывает растровые)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

В критерий на долю рисунков добавить min планку их количества

2 participants