Sync third-party and MCP marketplace plugins
Constraint: Public skills are published only by explicit administrator action unless they are tracked third-party market sources. Confidence: high Scope-risk: narrow Directive: Keep private/internal skills out of the public marketplace and preserve normal incremental market Git history. Tested: Marketplace validation passed.
This commit is contained in:
1 parent
be7ce9bda2
commit
36c089fee9
298 files changed
+32935
-11681
No files matched your search
@@ -0,0 +1,29 @@
|
||||
"""Render PDF pages without Poppler; requires PyMuPDF."""
|
||||
|
||||
import argparse
|
||||
from pathlib import Path
|
||||
|
||||
import pymupdf
|
||||
|
||||
|
||||
def convert(pdf_path, output_dir, max_dim=1600):
|
||||
if max_dim <= 0:
|
||||
raise ValueError("max_dim must be positive")
|
||||
output = Path(output_dir)
|
||||
output.mkdir(parents=True, exist_ok=True)
|
||||
with pymupdf.open(pdf_path) as document:
|
||||
for index, page in enumerate(document):
|
||||
scale = min(max_dim / page.rect.width, max_dim / page.rect.height)
|
||||
pixmap = page.get_pixmap(matrix=pymupdf.Matrix(scale, scale), alpha=False)
|
||||
target = output / f"page_{index + 1}.png"
|
||||
pixmap.save(str(target))
|
||||
print(target)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
parser = argparse.ArgumentParser(description=__doc__)
|
||||
parser.add_argument("input")
|
||||
parser.add_argument("output")
|
||||
parser.add_argument("--max-dim", type=int, default=1600)
|
||||
args = parser.parse_args()
|
||||
convert(args.input, args.output, args.max_dim)
|
||||
Reference in new issue
Block a user