versatileimagefield/image_warmer.py
def _prewarm_versatileimagefield(size_key, versatileimagefieldfile):
        """
        Returns a 2-tuple:
        0: bool signifying whether the image was successfully pre-warmed
        1: The url of the successfully created image OR the path on storage of
           the image that was not able to be successfully created.

        Arguments:
        `size_key_list`: A list of VersatileImageField size keys. Examples:
            * 'crop__800x450'
            * 'thumbnail__800x800'
        `versatileimagefieldfile`: A VersatileImageFieldFile instance
        """
        versatileimagefieldfile.create_on_demand = True
        try:
            url = get_url_from_image_key(versatileimagefieldfile, size_key)
        except Exception:
            success = False
            url_or_filepath = versatileimagefieldfile.name
            logger.exception('Thumbnail generation failed',
                             extra={'path': url_or_filepath})
        else:
            success = True
            url_or_filepath = url
        return (success, url_or_filepath)
def _prewarm_versatileimagefield(size_key, versatileimagefieldfile):
        """
        Returns a 2-tuple:
        0: bool signifying whether the image was successfully pre-warmed
        1: The url of the successfully created image OR the path on storage of
           the image that was not able to be successfully created.

        Arguments:
        `size_key_list`: A list of VersatileImageField size keys. Examples:
            * 'crop__800x450'
            * 'thumbnail__800x800'
        `versatileimagefieldfile`: A VersatileImageFieldFile instance
        """
        versatileimagefieldfile.create_on_demand = True
        try:
            url = get_url_from_image_key(versatileimagefieldfile, size_key)
        except Exception:
            success = False
            url_or_filepath = versatileimagefieldfile.name
            logger.exception('Thumbnail generation failed',
                             extra={'path': url_or_filepath})
        else:
            success = True
            url_or_filepath = url
        return (success, url_or_filepath)
Returns a 2-tuple:
        0: bool signifying whether the image was successfully pre-warmed
        1: The url of the successfully created image OR the path on storage of
           the image that was not able to be successfully created.

        Arguments:
        `size_key_list`: A list of VersatileImageField size keys. Examples:
            * 'crop__800x450'
            * 'thumbnail__800x800'
        `versatileimagefieldfile`: A VersatileImageFieldFile instance