我试图以90度角旋转它来操纵base64编码图像.在这个操作之后,我想将它转换回base64字符串.但遗憾的是无法实现这一目标.
这是我到目前为止所做的:
image_string = StringIO(base64.b64decode(base64_string_here))
image = Image.open(image_string)
angle = 90
rotated_image = image.rotate( angle, expand=1 )
Run Code Online (Sandbox Code Playgroud)
恩迪帮我如何将rotate_image转换为base64字符串.
这dir()是rotate_image:
[ '_Image__transformer', '__doc__', '__getattr__', '__init__', '__module__', '__repr__', '_copy', '_dump', '_expand', '_makeself', '_new', '类别',"转换", '复制', '剪裁', '草稿', '过滤器', '格式', 'format_description', 'fromstring', 'getbands', 'getbbox', 'getcolors', '的GetData', 'getextrema' , 'getim', 'GetPalette进行', 'getpixel', 'getprojection', '直方图', '聊天', '信息', '负载', '模式', '偏移', '调色板', '粘贴',"点','putalpha','putdata','putpalette','putpixel','量化','只读', '调整', '旋转', '拯救', '寻求', '秀', '大小', '分裂', '告诉', '缩略图', 'tobitmap', '的toString',"转换','transpose','验证']