Portrait handler

Portrait Handler

Module realize handler for obtaining the descriptor portrait.

class luna_backport3.app.handlers.portrait_handler.PortraitHandler(request)[source]

Handler for obtaining the descriptor portrait. If plug-in is activated, portrait is received by plug-in

Resource: “/{api_version}/storage/portraits/{descriptor_id}_{thumbnail}”

async get(descriptorId)[source]

Get descriptor portrait, see spec_get_descriptor_portrait.

Raises:
  • VLException(Error.ForbiddenError, 403, isCriticalError=False) is Luna-Image-Store is disabled

  • VLException(Error.ImageNotFoundError, 404, isCriticalError=False) if descriptor not found within the account

Return type:

HTTPResponse

luna_backport3.app.handlers.portrait_handler.resizeImage(binImage, maxSize)[source]
Parameters:
  • binImage – byte image

  • maxSize – max resized image size

Returns:

resized byte image

Return type:

bytes