SvenTiigi / WhatsNewKit

Showcase your awesome new app features 📱
https://sventiigi.github.io/WhatsNewKit/
MIT License
3.92k stars 193 forks source link

Image decoding from JSON #18

Closed bazscott closed 5 years ago

bazscott commented 5 years ago

Hi, I get a nil image when trying to decode the following Item from JSON. I get the title and subtitle ok. Everything else in the Kit works great, and I love it, but I just can't get the images to arrive. Thanks for your help.

Here's the JSON Item:

{
      "title": "Welcome",
      "subtitle": "Thanks for helping us test the next version of Bullclip, we really appreciate it. Please read this page for some tips and important notes.",
      "image": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGAAAABgCAYAAADimHc4AAAAAXNSR0IArs4c6QAAELlJREFUeAHtXAlwVEUa7v/NTEgILBIhcqmALisIXpME0EwSLiEHAVbD7rqI6C64Fmstpbvqaqm4pbLsSlEq6pZHeQClEkuQXIgcIQkgSUa3FFcEBU8uUQ4Tcsy81/v1JJO89+bMmzeYVL1Xlbzuv//u/vv/u///77/7DWPWY3HA4oDFAYsDFgcsDlgcsDhgccDigMUBiwMWBywOWBywOGBxwOKAxQGLAxYH4s4BinsPYTqYOL0oxdPUUMA5mwxChnHGBjNGQxhnvZE/yYn/QIw+Zox/wMjxXn3Vxg/DNNcji865AIqKimxfHmmczxmfz4hcnHNb1Jwj9jnqvNpXSlhVWbnhVNT1ujHiORVAWlZ+IefKMszwMbHwBESfYRKtHJh8ybKKiqdbYmnr5657TgTgzJk5gLzy65j1U80dMO2z22237qksed/cds9da3EXgDMrbxzjfCNm/fBQwyJizdD9btiCw8ARf02M2AAQNwyw8bAB/UPVRb1WidjtddXlr4TG6b4lcRVAhit/usyUt8D8PoEsIIWIryOSivsnpry7efPqxkAcsJ5zSs+edRXjnls5o5sBOC8YHoT4QH11xePByrozLG4CaJ/5u4Iyn6iMbHRffWXZ3q4wxzm1qB+1ND4EodyJeg59XYlJi+tqyp7Vw7tzPi4CEDqfyd66QLVjjrpwumZew7i8HuvjIi1zSbFJfFptVcU2Lbz75qR4kCYMbgDziU5IEk0yQ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EFwl4vrjWqYWekeLQBzY020X/zgU1/b+CttTFqpYzDJHs90HcyUbI9WQSLWFKBGVLEmcGjThKz80V6uCP2dDa/oMrwHYictjO0J7Ky/hLtUjdjOZgTXdrT5+GXCHd3R4D3ehJkvNoBtD2fCC3rNnzXr3WONcKhYEwb0Ca7Lvsls9mKjH4MI7yw9K19cb8zSMNomTXbvKNuugcWY6ZECiDrWRL5f3V2Po9y9WOoHk+yOL4L94KuINdEpPpaT7ILBzYJ1zsTKwi5c9xD7Hh8V3lC7owxRWnOeHiMA/z4Dw44l1gT7is0hPmmF+knG0WdfxJpwt1N72B6BtfhkjA6gfj3ZaVlXf3hQ33aPEUCwnbZ+MD9D/vj5vQeMjPSdQji6epAXFHWsKaa7mnpmYYZ+1nZIpC/x5VNPn/1RGHbDT48RABhRpR+lUCdgznzE5x+urSyvx251YWJ/xxBJYr+FmnkFquKovk6kPGJIXtSrFT+1YHPYrsKp3WUJCfi1LUZbgtQ93q93SgxffYpISQ95fDagqfFhUtgvQXLMsSa00QvDx/UXLlbMEYlLB/CxxmfJtkR3ZWVx0FWUnpk3AwYgH3WGw1CfMcMG9BD2W2RaHLA4YHHA4oDFAYsDFgcsDlgcsDhgccDigMUBiwMWBywOWBywOGBxwOKAxQGLAxYHei4H/g+c7D+JW5vTeAAAAABJRU5ErkJggg=="
    }
SvenTiigi commented 5 years ago

Hey @bazscott,

Please drop the data:image/png;base64, prefix.

Bildschirmfoto 2019-03-18 um 18 43 22

I've also updated the ReadMe which falsely contained this prefix 👌

bazscott commented 5 years ago

Thanks very much Sven, it worked. D'oh! :) Though I was sure I tried that, but clearly not. Thanks very much for the fast reply 👍