Quellcodebibliothek Statistik Leitseite products/Sources/formale Sprachen/Python/Sympy/doc/src/explanation/modules/physics/     Datei vom 6.10.2026 mit Größe 283 B image not shown  

SSL images.py   Sprache: Python

 

"""Example showing image handling with MCPServer."""

from PIL import Image as PILImage

from mcp.server.mcpserver import Image, MCPServer

mcp = MCPServer("Image Example")


@mcp.tool()
def create_thumbnail(image_path: str) -> Image:
    """Create a thumbnail from an image"""
    img = PILImage.open(image_path)
    img.thumbnail((100, 100))
    return Image(data=img.tobytes(), format="png")

Messung
CHZG
939610096

¤ Dauer der Verarbeitung: 0.45 Sekunden  ¤

*© Formatika GbR, Deutschland