我想解码一个正确的base64
字符串图片(我可以打印为html <img src=... />
)并在UIImageView
中进行可视化。
[Base64 initialize];
NSData *data = [Base64 decode:img];
cell.image.image = [UIImage imageWithData:data];
我尝试了this解决方案,但似乎无法在ios6上运行(我无法看到给出该代码的图像。当然我导入了Base64.h
文件。
我的base64编码图像:
data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAFAAAABOCAYAAAHAyqHQAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAIGNIUk0AAG2YAABzjgAA47MAAIZgAAB5jQAAz5oAADF1AAAdKk1oIhIAADlCSURBVHjaPMoxSwJhAAbg987vQkXQEqELNR1sMZ2zhqbMf+Bklw3nEBWi0CKJbo0OiZttQsIJXU4NLgoNLjpc+QVCeA4mYgmBCnkNYsOzPawsy1ipVqsQBAFXF5d7qVQKlNJ/7GQywUq9Xj/07HjgcrleIpEIut3uP3bX68VKr9c7abfaB/l8XpMkCYQQEI4D4Tiwg8EnVn6nM10ykWhIFYlxu932p0f5xmQwwmQwgrU77LCYzbCYzYgnk6eh45Cm9vvo99T9eDye5XkePM+DBYDXzhuK90UsoCGdzTBOpxObW/zDdD7DWTSKzjtdRgCABhBC4Pf5tofDIZrN5rmiKNARAgDLyDAMKKVQVRWtVuujUCjAZrPdNRoNLBYLaJoGdjQaQa/Xr4+/v9q1Wi1DKb2OxWIbwWAQ5XJ5Tta450qlAtbhcMBqtY5LpZI/EAikBUG4DYfDiiiKA47jfnK53JEoivgDAAD//3TRPUsCYQAH8P9dlvWgq1NQURxqLzhGUxAiDoLg0ni9XZPQFwhNuHqewWwObsrAwSC1G0Mk0JYTJ4fqxgoHucGGPI+eJq2Qfl/hJ/6eMQwDezu7eH99+7MyNkMp9YRCodhVPo9IJML/nclkMh/nuVw5HA5D0zRhuDI2IwgC0ifpzUajDuVQ4cMVzwyB6HJNjGbO1NN1xtg1owx3pcr0cGXK7YZoNJuo1Wr4Ase+cvDo9/tnV9ZWUaqU+592H71eDwNn8DPDOUehUIDP57tIJp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0sAHQBEGQTCbzxYTK3/V5abVaDB48GLNnz0ZgYOCLCNsfCA6vvQN7T/n/CYIgNHZ2dufd3NyOubi4nPDy8op3cnKq5fF4KgcHh/NeXl6nHBwcfhwwYMBRGxubPL1eDzc3txtCobCIwWCAw+HI+vXrd83V1TX75exHmJmZPfT09Fzn6ur6I0mS1dbW1tUmJiaQy+UgSbLNzc3tsIWFxTYPD48TFEXJjEYj2Gw2hEJhtru7+xkHB4ej7u7uRz08PE4JBAKhlZVVe2dn54zS0lJUVlb+CxUVFSgtLUVZWRmqq6vx8jiFf+e9/M8AP9duncg9fOYAAAAASUVORK5CYII=
是真的吗? 有什么建议吗?
提前谢谢 达里奥答案 0 :(得分:7)
问题是,您要为NULL
传递img
,要么img
的长度不能被4整除。这是解码功能可以使用的唯一两种方式返回nil
。
来自base64的源代码:
if ((string == NULL) || (inputLength % 4 != 0)) {
return nil;
}
我猜你的具体问题是你传递的内容如下:
数据:图像/ GIF; BASE64,R0lGODlhUAAPAKIAAAsLav /// 88PD9WqsYmApmZmZtZfYmdakyH5BAQUAP8ALAAAAABQAA8AAAPb \ nWLrc / jDKSVe4OOvNu / 9gqARDSRBHegyGMahqO4R0bQcjIQ8E4BMCQc930JluyGRmdAAcdiigMLVr \ nApTYWy5FKM1IQe + MP + L4rphz + qIOBAUYeCY4p2tGrJZeH9y79mZsawFoaIRxF3JyiYxuHiMGb5KT \ nkpFvZj4ZbYeCiXaOiKBwnxh4fnt9e3ktgZyHhrChinONs3cFAShFF2JhvCZlG5uchYNun5eedRxM \ nAF15XEFRXgZWWdciuM8GCmdSQ84lLQfY5R14wDB5Lyon4ubwS7jx9NcV9 / J5 + g4JADs =
如果是这种情况,那么您需要从头开始删除data:image/gif;base64,
部分,因为它不是base64编码数据的一部分。我假设您只需要将字符串拆分为第一个,
并取右手部分。