We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/PovedaAqui/auto-snap-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server
pdf_utils.cpython-312.pyc•10.6 kB
�
2�h�$ � � � d Z ddlZddlmZmZ ddlmZ ddlZddlm Z ddl
Z
ddlmZm
Z
e
j e� Z G d� d� Zy) zB
PDF conversion utilities for converting images to PDF documents.
� N)�List�Optional)�Path)�Image)�
get_config�get_output_directoryc �� � e Zd ZdZd� Zddededefd�Z ddee ded ed
e e def
d�Z
ddeded
ed
e e def
d�Zddede e defd�Zdede
fd�Zdee de
fd�Zy)�PDFConverterz.Handles conversion of images to PDF documents.c � � h d�| _ y )N> �.bmp�.jpg�.png�.jpeg�.tiff)�supported_formats)�selfs �-/home/luispoveda93/auto-snap-mcp/pdf_utils.py�__init__zPDFConverter.__init__ s
� �!K��� �output_path�
use_config�returnc � � t |� }|j � r|S |r4t � }|j � r|S t � }t ||z � S |S )a9
Resolve output path using configuration if it's a relative path.
Args:
output_path: The output path (can be relative or absolute)
use_config: Whether to use configuration for relative paths
Returns:
Resolved absolute path
)r �is_absoluter �should_use_legacy_moder �str)r r r �path_obj�config�
output_dirs r �resolve_output_pathz PDFConverter.resolve_output_path s\ � � ��$�����!�����\�F��,�,�.�"�"� 2�3�
��:��3�4�4��r N�image_paths�
sort_files�titlec �L � g }|D ]� }t j j |� r\t |� j j � }|| j v r|j |� �et j d|� �� �~t j d|� �� �� |st d� �|r|j � t j dt |� � d�� t j j |� }|rt j |d�� t! |d� 5 } | j# t% j&