Skip to content

pix.color_topusage raise Segmentation fault (core dumped) #3994

Closed
@ytcpub

Description

@ytcpub

Description of the bug

test3.pdf

I test diffirent colorspace, and reduce the bbox, it always raise "Segmentation fault", I don't know why

How to reproduce the bug

import fitz
doc = fitz.open('test3.pdf')
page = doc[0]
txt_blocks = [blk for blk in page.get_text('dict')['blocks'] if blk['type']==0]
for blk in txt_blocks:
	pix = page.get_pixmap(clip=fitz.Rect([int(v) for v in blk['bbox']]), colorspace=fitz.csRGB, alpha=False)
	percent, color = pix.color_topusage()

PyMuPDF version

1.24.12

Operating system

Linux

Python version

3.12

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions