• <i id='n9GL7'><tr id='n9GL7'><dt id='n9GL7'><q id='n9GL7'><span id='n9GL7'><b id='n9GL7'><form id='n9GL7'><ins id='n9GL7'></ins><ul id='n9GL7'></ul><sub id='n9GL7'></sub></form><legend id='n9GL7'></legend><bdo id='n9GL7'><pre id='n9GL7'><center id='n9GL7'></center></pre></bdo></b><th id='n9GL7'></th></span></q></dt></tr></i><div id='n9GL7'><tfoot id='n9GL7'></tfoot><dl id='n9GL7'><fieldset id='n9GL7'></fieldset></dl></div>
  • <small id='n9GL7'></small><noframes id='n9GL7'>

  • <legend id='n9GL7'><style id='n9GL7'><dir id='n9GL7'><q id='n9GL7'></q></dir></style></legend><tfoot id='n9GL7'></tfoot>

          <bdo id='n9GL7'></bdo><ul id='n9GL7'></ul>

        如何将base64字符串转换为图像?

        时间:2023-08-30
          <bdo id='jEdVn'></bdo><ul id='jEdVn'></ul>
        • <i id='jEdVn'><tr id='jEdVn'><dt id='jEdVn'><q id='jEdVn'><span id='jEdVn'><b id='jEdVn'><form id='jEdVn'><ins id='jEdVn'></ins><ul id='jEdVn'></ul><sub id='jEdVn'></sub></form><legend id='jEdVn'></legend><bdo id='jEdVn'><pre id='jEdVn'><center id='jEdVn'></center></pre></bdo></b><th id='jEdVn'></th></span></q></dt></tr></i><div id='jEdVn'><tfoot id='jEdVn'></tfoot><dl id='jEdVn'><fieldset id='jEdVn'></fieldset></dl></div>

            1. <tfoot id='jEdVn'></tfoot>
            2. <legend id='jEdVn'><style id='jEdVn'><dir id='jEdVn'><q id='jEdVn'></q></dir></style></legend>
                    <tbody id='jEdVn'></tbody>

                  <small id='jEdVn'></small><noframes id='jEdVn'>

                  本文介绍了如何将base64字符串转换为图像?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我正在将图像转换为 base64 字符串并将其从 android 设备发送到服务器.现在,我需要将该字符串改回图像并将其保存在数据库中.

                  I'm converting an image to base64 string and sending it from android device to the server. Now, I need to change that string back to an image and save it in the database.

                  有什么帮助吗?

                  推荐答案

                  试试这个:

                  import base64
                  imgdata = base64.b64decode(imgstring)
                  filename = 'some_image.jpg'  # I assume you have a way of picking unique filenames
                  with open(filename, 'wb') as f:
                      f.write(imgdata)
                  # f gets closed when you exit the with statement
                  # Now save the value of filename to your database
                  

                  这篇关于如何将base64字符串转换为图像?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  上一篇:是否可以从 Image 对象创建编码的 base64 URL? 下一篇:在 Python 中将 base64 转换为图像

                  相关文章

                    1. <i id='uIxrl'><tr id='uIxrl'><dt id='uIxrl'><q id='uIxrl'><span id='uIxrl'><b id='uIxrl'><form id='uIxrl'><ins id='uIxrl'></ins><ul id='uIxrl'></ul><sub id='uIxrl'></sub></form><legend id='uIxrl'></legend><bdo id='uIxrl'><pre id='uIxrl'><center id='uIxrl'></center></pre></bdo></b><th id='uIxrl'></th></span></q></dt></tr></i><div id='uIxrl'><tfoot id='uIxrl'></tfoot><dl id='uIxrl'><fieldset id='uIxrl'></fieldset></dl></div>

                      <legend id='uIxrl'><style id='uIxrl'><dir id='uIxrl'><q id='uIxrl'></q></dir></style></legend>

                    2. <tfoot id='uIxrl'></tfoot>

                      <small id='uIxrl'></small><noframes id='uIxrl'>

                      • <bdo id='uIxrl'></bdo><ul id='uIxrl'></ul>