示例#1
0
def downloadPicture(urlId):
    picturePathAndName = ServerDbSevice.getPicturePathAndName(urlId)
    if not picturePathAndName:
        abort(404)
    else :
        imageAsByte = FileFolderService.readImage(picturePathAndName[1])
        return send_file(io.BytesIO(imageAsByte),
                         as_attachment=True,
                         attachment_filename=CfgService.get(CfgKey.PROJECTNAME)+"_"+picturePathAndName[0]+'.png',
                         mimetype='image/png')
示例#2
0
def displayBackground_image(uuid,number):
    print("PictureHash: "+number)
    if uuid is None:
        abort(404)
    authorizade = ServerDbSevice.getBackgroundUploadAuthorization(uuid)
    if authorizade is None:
        abort(404)
    filePath = GreenscreenBackgroundService.getCustomFilePathWithName(authorizade["targetPath"],uuid)
    imageAsByte = FileFolderService.readImage(filePath)
    return send_file(io.BytesIO(imageAsByte),
                     as_attachment=True,
                     attachment_filename=FileFolderService.getFileName(filePath),
                     mimetype='image/'+FileFolderService.getFileType(filePath).replace("\.",""))