PHP add iTXt comment to a PNG image

前端 未结 1 1227
没有蜡笔的小新
没有蜡笔的小新 2021-01-26 13:05

I have looked around for this everywhere. I know it can be done using some libraries in .net, but I really want my script to generate a \"marked\" image. The reason is that we a

1条回答
  •  不思量自难忘°
    2021-01-26 13:14

    A suggestion: If you have a fixed iTXt chunk that you want to add to an image, a quick and dirty procedure could be to simply insert it just before the IEND chunk (12 bytes) of the original image. This should work, because the iTXt can be placed before of after the image data. Of course, this does not check if the chunk as already there.

    Here's an example code, using the tEXt chunk (slightly simpler), it needs some polishing but it basically works:

    
    

    0 讨论(0)
提交回复
热议问题