o
    h                     @   s    d dl mZ dd Zdd ZdS )    )SourceImageIOErrorc                 C   sB   z|  |W S  ty    | jj}|| ddd}d|j_| Y S w )z
    Tries to get / create the rendition for the image or renders a not-found image if it does not exist.

    :param image: AbstractImage
    :param specs: str or Filter
    :return: Rendition
    r   imagewidthheight	not-found)get_renditionr   
renditionsmodelfilename)r   specs	Rendition	rendition r   X/var/www/html/ndineBlogger/venv/lib/python3.10/site-packages/wagtail/images/shortcuts.pyget_rendition_or_not_found   s   r   c                    sP   z| j | W S  ty'   | jj}|| ddd d j_ fdd|D  Y S w )a  
    Like get_rendition_or_not_found, but for multiple renditions.
    Tries to get / create the renditions for the image or renders not-found images if the image does not exist.

    :param image: AbstractImage
    :param specs: iterable of str or Filter
    r   r   r   c                    s"   i | ]}t |tr|n|j qS r   )
isinstancestrspec).0r   r   r   r   
<dictcomp>(   s    z/get_renditions_or_not_found.<locals>.<dictcomp>)get_renditionsr   r	   r
   r   r   )r   r   r   r   r   r   get_renditions_or_not_found   s   

r   N)wagtail.images.modelsr   r   r   r   r   r   r   <module>   s    