Skip to content

Commit c0cd8b6

Browse files
committed
Remove unneeded png:ignore_text_chunks
This unblocks reading XMP metadata, which Adobe put into a generic text chunk for some reason. We're not going to question it. There may be other information that may be buried in text chunks of sorts. This option was previously set to ignore text chunks entirely since png<=0.17 would error on malformed chunks even when they were ancillary. But some real world images have UTF8 text in an tEXT Latin-1 chunk or similar dubious encoding issues. Those must not influence our ability to display such images though, they exist in the wild.
1 parent 7d475da commit c0cd8b6

File tree

1 file changed

+0
-1
lines changed

1 file changed

+0
-1
lines changed

src/codecs/png.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,6 @@ impl<R: BufRead + Seek> PngDecoder<R> {
4545

4646
let max_bytes = usize::try_from(limits.max_alloc.unwrap_or(u64::MAX)).unwrap_or(usize::MAX);
4747
let mut decoder = png::Decoder::new_with_limits(r, png::Limits { bytes: max_bytes });
48-
decoder.set_ignore_text_chunk(true);
4948

5049
let info = decoder.read_header_info().map_err(ImageError::from_png)?;
5150
limits.check_dimensions(info.width, info.height)?;

0 commit comments

Comments
 (0)