Commit 1737b8f 1 parent 90ceef9 commit 1737b8f Copy full SHA for 1737b8f
File tree 1 file changed +4
-2
lines changed
1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -186,9 +186,11 @@ impl PngData {
186
186
// Ancillary chunks - split into those that come before IDAT and those that come after
187
187
let mut aux_split = self . aux_chunks . split ( |c| & c. name == b"IDAT" ) ;
188
188
let aux_pre = aux_split. next ( ) . unwrap ( ) ;
189
+ // Many chunks need to be before PLTE, so write all except those that explicitly need to be after
190
+ // Note: fcTL does not strictly need to be after PLTE but some software may expect it
189
191
for chunk in aux_pre
190
192
. iter ( )
191
- . filter ( |c| !( & c. name == b"bKGD" || & c . name == b"hIST" || & c . name == b"tRNS " ) )
193
+ . filter ( |c| !matches ! ( & c. name, b"bKGD" | b"hIST" | b"tRNS" | b"fcTL " ) )
192
194
{
193
195
write_png_block ( & chunk. name , & chunk. data , & mut output) ;
194
196
}
@@ -223,7 +225,7 @@ impl PngData {
223
225
// Special ancillary chunks that need to come after PLTE but before IDAT
224
226
for chunk in aux_pre
225
227
. iter ( )
226
- . filter ( |c| & c. name == b"bKGD" || & c . name == b"hIST" || & c . name == b"tRNS" )
228
+ . filter ( |c| matches ! ( & c. name, b"bKGD" | b"hIST" | b"tRNS" | b"fcTL" ) )
227
229
{
228
230
write_png_block ( & chunk. name , & chunk. data , & mut output) ;
229
231
}
You can’t perform that action at this time.
0 commit comments