# Path: rst2pdf/log.py
# def nodeid(node):


from copy import copy
from os.path import abspath, dirname
from urllib.request import urlretrieve
from PIL import Image as PILImage
from reportlab.platypus.flowables import Image, Flowable
from reportlab.lib.units import cm, inch
from .log import log, nodeid
    from .svgimage import SVGImage
import glob
import os
import sys
                    log.error(
                        "The image (%s, %s) is broken or in an unknown format",
                        imgname,
                        nodeid(node),
                    )
                    raise ValueError
                else:
                    # Can be handled by reportlab
                    log.warning(
                        "Can't figure out size of the image (%s, %s). Install PIL for better results.",
                        imgname,
                        nodeid(node),
                    )
                    iw = 1000
                    ih = 1000

        # Try to get the print resolution from the image itself via PIL.
        # If it fails, assume a DPI of 300, which is pretty much made up,
        # and then a 100% size would be iw*inch/300, so we pass
        # that as the second parameter to adjustUnits
        #
        # Some say the default DPI should be 72. That would mean
        # the largest printable image in A4 paper would be something
        # like 480x640. That would be awful.
        #

        w = node.get('width')
        h = node.get('height')
        if h is None and w is None:  # Nothing specified
            # Guess from iw, ih

# Path: rst2pdf/log.py
# def nodeid(node):


# Path: rst2pdf/image.py
from copy import copy
from os.path import abspath, dirname
from urllib.request import urlretrieve
from PIL import Image as PILImage
from reportlab.platypus.flowables import Image, Flowable
from reportlab.lib.units import cm, inch
from .log import log, nodeid
    from .svgimage import SVGImage
import glob
import os
import sys

                    log.error(
                        "The image (%s, %s) is broken or in an unknown format",
                        imgname,
                        nodeid(node),
                    )
                    raise ValueError
                else:
                    # Can be handled by reportlab
                    log.warning(
                        "Can't figure out size of the image (%s, %s). Install PIL for better results.",
                        imgname,
                        nodeid(node),
                    )
                    iw = 1000
                    ih = 1000

        # Try to get the print resolution from the image itself via PIL.
        # If it fails, assume a DPI of 300, which is pretty much made up,
        # and then a 100% size would be iw*inch/300, so we pass
        # that as the second parameter to adjustUnits
        #
        # Some say the default DPI should be 72. That would mean
        # the largest printable image in A4 paper would be something
        # like 480x640. That would be awful.
        #

        w = node.get('width')
        h = node.get('height')
        if h is None and w is None:  # Nothing specified
            # Guess from iw, ih

            log.debug(