mirror of
https://git.code.sf.net/p/libpng/code.git
synced 2025-07-10 18:04:09 +02:00
tIME and text position handling
The handling of tIME and text chunks on read now records the location of the chunks relative to PLTE and IDAT. Behavior on write is unchanged except that if the position was recorded on read it will be re-used. This involves an ABI change to the png_text_struct; a one byte location field is added (with the same meaning as the one used to record unknown chunk location.) Because this field is only used on read there is no API change unless a png_info from a libpng read is passed to a subsequent libpng write (this did not work very well before 1.7; the tIME chunk could get duplicated.) png_set_text ignores the new field, resetting it to the current position in the read or write stream. On write the position is set to the next location to be written unless the write has not started (the position is before the signature) in which case the location is set to PNG_HAVE_PLTE|PNG_AFTER_IDAT. When the chunk is written the position is set to the actual write location (effectively the position is frozen.) Signed-off-by: John Bowler <jbowler@acm.org>
This commit is contained in:
@@ -400,9 +400,6 @@ struct png_struct_def
|
||||
unsigned int palette_index_check_disabled :1; /* defaults to 0, 'enabled' */
|
||||
unsigned int palette_index_check_issued :1; /* error message output */
|
||||
#endif /* CHECK_FOR_INVALID_INDEX */
|
||||
#ifdef PNG_WRITE_tIME_SUPPORTED
|
||||
unsigned int wrote_tIME :1; /* Stop writing of duplicate tIME chunks */
|
||||
#endif /* WRITE_tIME */
|
||||
#ifdef PNG_READ_tRNS_SUPPORTED
|
||||
png_color_16 trans_color; /* transparent color for non-paletted files */
|
||||
#endif /* READ_tRNS */
|
||||
|
||||
Reference in New Issue
Block a user