Technically Images can be Stored on BlockChain 差一点 SteemIt 就可以把图片也存在区块链上了

in #steemit7 years ago (edited)

As you probably know, the SteemIt stores the images on AWS cloud servers. This is different from the texts (post content), which are stored in block-chain (e.g. lots of peer-to-peer nodes storing duplicate and immutable) contents.

也许你知道,STEEM上文字是放在区块链上而 STEEM的图片是单独放在AWS云服务器上的。我就突然想到,其实图片也是可以通过BASE64格式把二进制的内容编码成纯文本的BASE64格式。

This is fine.. but I suddenly realized that the images can be embeded in HTML text as well, so instead of giving a actual URL for image for example,

比如你原来这样在HTML中添加图片:

Yes, as you can see, the image content (binary) is converted into BASE64-format, which is a pure text format. 

这样的话, 图片就和文字混在一起了 。

So, let's try to do this!

Step 1: Convert Images to BASE64-text string, you can use this online API I created years ago (remember to replace the image URL):

我想试验一下,就用N年前写的API来转换图片 (记得把图片改成你的图片地址)

https://helloacm.com/api/image-to-base64/?url=https://justyy.com/gif/dr.zhihua.lai/13.gif

Copy the base64-encoded image and place it at:

把内容拷到插入图片的文本框中。

As you can see, the image appears in the text-editor, but when you click POST, it actually fails (image cannot save). The message is to say that this particular image cannot be uploaded to AWS server (but, why you want to do that, steemit, e.g. I have already embeded the image ...)

图片可以显示,但是发表却失败了。

So, I am guessing: either this is a BUG which can be easily fixed by the developers, or it is by design, because the images are generally big and by using BASE64-encoded, the image size grows 1/3 e.g. 3MB to 4MB.

What do you think?  Please re-steem for more visibility.  

我猜想两种可能:要么这是一个BUG,可以很轻易的被修复,要么就是设计就是这样,因为可能图片本来就很大,用了BASE64文字编码后大小会增加1/3。。。

您认为呢?不管怎么样:差一点 SteemIt 就可以把图片也存在区块链上了!

 Originally published at https://steemit.com Thank you for reading my post, feel free to FOLLOW and Upvote @justyy which motivates me to create more quality posts.

原创首发于 https://steemit.com 非常感谢阅读, 欢迎FOLLOW和Upvote @justyy  能激励我创作更多更好的内容.  

// 已同步到我的中文博客 英文算法博客。   

近期热贴 Recent Popular Posts 

Sort:  

pretty cool : )

有没有试试直接API发送?

好注意,没试过,因为不太懂用API,太难了。

你如果打开console就会发现,steemit里的src要求必须是url

哪个 console? 怎么玩?

就是chrome里的console, 我看了一下steemit的前端源代码,发现它把src标签最前边都加上了https://steemitimages.com/0x0/, 即使用api插入也显示不了.

能留在blockchain 就是一大進步

@abit 说本来就可以存,需要编码解码,我想应该是我操作的问题,我再研究研究

加油~等你研究結果~

如果区块链能储存图片的话,那节点需要的硬盘容易就会特别大吧?我感觉图片和视频存储还需要解决很多问题。

对的,图片其实还好,平均1M左右吧。

If I keep reading this one, maybe I will understand it in the future! Thanks @justyy

Thanks for reading..

How great if this can happens

I guess there are some other reasons why this can't work out.

之前好像看 O 哥提过,还想试试呢……

哦?在哪提的?

感谢分享,O哥威武

前几天也有过类似想法
不过图片用base64编码之后文本量确实太大了
下午群里有人说了视频方向的dtube
国内访问速度堪忧 而且用base64编码的话太大了
数据压缩是个问题

对的,不过对于小图片就挺适用的。

Coin Marketplace

STEEM 0.18
TRX 0.14
JST 0.030
BTC 58752.84
ETH 3153.55
USDT 1.00
SBD 2.44