使用 C 对 bmp 文件进行游程编码时的平台相关问题

发布于 2024-07-16 01:18:40 字数 185 浏览 3 评论 0原文

我编写了一个程序,它打开一个 bmp 文件并将其视为字符文件并对其执行游程长度编码。 它生成一个有效的压缩编码文件,我再次读取该文件以执行解码。

当我制作该应用程序时,我使用的是 Fedora,它运行得非常好。 现在我在 ubuntu 上运行它,但它无法工作。

知道出了什么问题吗? 我担心这与编码有关。

I've written a program which opens a bmp file and treats it as a character file and performs run length encoding on it. It produces a valid compressed encoding file, which I read again to perform the decoding.

When i'd made the application i was using Fedora and it ran perfectly fine. Now i'm running it on ubuntu and it refuses to work.

Any idea what is wrong? I fear it has to do with the encoding.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

童话里做英雄 2024-07-23 01:18:40

我首先建议使用源代码调试器来查找问题。

可能的原因包括在不同的系统上使用不同的编译器,这可能会执行不同的操作,例如打包结构(例如,BITMAPFILEHEADER)。 您还可能在两个系统上有不同的 CPU 架构(64 位与 32 位)。

您还可以使用十六进制编辑器(例如,XVI32)来检查两个版本的程序生成的 BMP 文件之间的差异。

I would first and foremost suggest using a source code debugger to find the problem.

Possible causes include using different compilers on the different systems, which might do different things with, for example, packing structs (e.g., BITMAPFILEHEADER). You also might have different CPU architectures on the two systems (64- vs. 32-bit).

You can also use a hex editor (e.g., XVI32) to examine the differences between BMP files generated by the two versions of your program.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文