Jump to content

Making .gif files work


.:HyPeX:.

Recommended Posts

Hello everyone, i just had an idea crossing my mind.

Whenever you download an image, you can have it as a simple text string.

Now, my question is, knowing how the .gif image is coded, couldnt some code decode it into images manually?

(To fix the need to do it manually with the usefull function dxDrawGifImage)

So far this is how an image is in a text string:

yi3jK25.png

I belive this is not possible to "decode" itself, but if we could just open it like hexeditor does..

Empty_GIF_hex.png

Then decoding it and separating every image shouldnt be that hard. (Comparatively)

Is it possible by any means in MTA?

EDIT: It seems like it al relies on being able to go back and forth to the hex, this page seemed pretty easy:

http://www.flexhex.com/docs/howtos/hex-editing.phtml

Link to comment

It is possible, indeed, to read and parse the GIF file in-game. I wrote a parser for MTA long ago, but it is unfinished, and honestly, there's really no point in continuing it. But if you really want to do it, you'll need the specification for the GIF89a file format (http://www.w3.org/Graphics/GIF/spec-gif89a.txt). You'll also have to implement a compression algorithm needed to decode the image data, and then convert that data to a format that the MTA functions can read (which is, obviously, not covered by the specification - you'll have to figure that out on your own).

Honestly, I wouldn't do it again. It's not worth it. And you too will eventually realize it's a waste of time.

Link to comment
It is possible, indeed, to read and parse the GIF file in-game. I wrote a parser for MTA long ago, but it is unfinished, and honestly, there's really no point in continuing it. But if you really want to do it, you'll need the specification for the GIF89a file format (http://www.w3.org/Graphics/GIF/spec-gif89a.txt). You'll also have to implement a compression algorithm needed to decode the image data, and then convert that data to a format that the MTA functions can read (which is, obviously, not covered by the specification - you'll have to figure that out on your own).

Honestly, I wouldn't do it again. It's not worth it. And you too will eventually realize it's a waste of time.

Okay, thanks!

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...