quote:
Originally posted by lhunath
Right, so I found an easy way to encode a gif in a png.
With imagemagick :
mogrify -comment "@[uri-to-gif]" [uri-to-png]
Then; the produced png is to be set as DP
Afterwards, the other side receives the png, and does this :
identify -format "%c" [uri-to-png] > [uri-to-gif]
Well; something like that anyway.
NO!!! You must not do that!!!
If your serious about all this, I suggest you to read, learn and
fully understand the PNG format (although you don't need to know the compression methods for the actual image, you can skip that)
(PNG's consist of "chuncks")
We said that you could add another file to the comment field of a PNG, well it's not THAT easy. First of all a comment field is part of a "iTXt", "tEXt", or "zTXt" chunck (mind the casing!!!). And this can only contain text for the soul purpose of compatibility. So, if you want to incorporate an animated GIF to a PNG, you must create your own type of chunck.
This new chunck must meet certain criteria. For this purpose (adding another image for your plugin to use) it must be:
- private (not public)
- ancillary (not critical)
- safe-to-copy (not unsafe)
Now, the name of a chunck must be 4 bytes long (4 characters), nothing less, nothing more and the casing does matter!!!
To reflect the above chunck criteria, your name must be lowercased-lowercased-uppercased-lowercased.
Also, the name must be one that is not in use already. So if you choose "AMSN" (for nimated-msn-picture or something) it must be "amSn".
Also, the chunck data itself can not exceed 2^31-1 bytes (I thought, I need to look this up again myself). If you need more (not likely as this is 4GB!), you can create two chuncks (with same name, but then you must make your decoder also aware of this of course)
And while you implement all this in your "PNG"-to-"PNG incl. ani-GIF" converter, I suggest you to fill in the comment, software, warning, disclaimer, source, Author fields of a PNG also. (all this for compatibility and information sake)...
Also, note that there are different version of PNG's (1.0, 1.1, 1.2). Your program needs to be able to handle them all!
So you see, implementing another image into PNG is easy if you know how, but you must know the PNG-format by hart. And you must be good at reading/writing fileformats and understand the conventions...
More info can be found on (this must be learned and studied before attempting something):
http://www.libpng.org/pub/png/
http://www.libpng.org/pub/png/spec/
quote:
Originally posted by PaPalemon
Y not make the display pic Display as GIF? so the file will be sent once then it will be animated?
Because for that you need to change the way MSN Messenger actually works. And those changes will be very very huge! It's not doable...