模糊图像 [英] Obfuscating images

查看:136
本文介绍了模糊图像的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想分发一些图像,不允许其他人看到它们,除非他们正在使用我的程序。我的意图是使用JPG文件,其中我将更改标题,以便其他图像查看器不能再读取它们。例如我可以删除字符7-10这是JPG的魔术签名。稍后,我的程序将重建标题并显示JPG文件。

I want to distribute a few images and not allow others to see them unless they are using my program. My intention will be to use JPG files in which I will alter the header so other image viewers cannot read them anymore. For example I can delete the bytes 7-10 which are the magic signature for JPG. Later, my program will reconstruct the header and show the JPG file.

问题:如何在飞行中执行此操作,而无需阅读损坏的JPG文件,恢复标题,将好的文件保存到磁盘,然后重新加载为好的JPG文件?

Question: how do I do this on the fly, without reading the "broken" JPG file, restoring the header, saving the good file to disk and then re-loading it as a "good" JPG file?

推荐答案

加载破碎文件转换为TMemoryStream ,补丁内存中的字节,并使用TGraphic.LoadFromStream()加载固定的JPG文件。

Load the "broken" file into a TMemoryStream, patch the bytes in-memory, and use TGraphic.LoadFromStream() to load the fixed JPG file.

这篇关于模糊图像的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆