44using System ;
55using System . Buffers ;
66using System . Buffers . Binary ;
7- using System . Collections . Generic ;
87using System . IO ;
98using System . IO . Compression ;
109using System . Runtime . CompilerServices ;
@@ -380,8 +379,8 @@ public IImageInfo Identify(BufferedReadStream stream, CancellationToken cancella
380379 /// <summary>
381380 /// Reads the least significant bits from the byte pair with the others set to 0.
382381 /// </summary>
383- /// <param name="buffer">The source buffer</param>
384- /// <param name="offset">THe offset</param>
382+ /// <param name="buffer">The source buffer. </param>
383+ /// <param name="offset">THe offset. </param>
385384 /// <returns>The <see cref="int"/></returns>
386385 [ MethodImpl ( MethodImplOptions . AggressiveInlining ) ]
387386 private static byte ReadByteLittleEndian ( ReadOnlySpan < byte > buffer , int offset )
@@ -392,7 +391,7 @@ private static byte ReadByteLittleEndian(ReadOnlySpan<byte> buffer, int offset)
392391 /// specified number of bits.
393392 /// </summary>
394393 /// <param name="source">The bytes to convert from. Cannot be empty.</param>
395- /// <param name="bytesPerScanline">The number of bytes per scanline</param>
394+ /// <param name="bytesPerScanline">The number of bytes per scanline. </param>
396395 /// <param name="bits">The number of bits per value.</param>
397396 /// <param name="buffer">The new array.</param>
398397 /// <returns>The resulting <see cref="ReadOnlySpan{Byte}"/> array.</returns>
@@ -973,6 +972,10 @@ private void AssignTransparentMarkers(ReadOnlySpan<byte> alpha, PngMetadata pngM
973972 pngMetadata . HasTransparency = true ;
974973 }
975974 }
975+ else if ( this . pngColorType == PngColorType . Palette && alpha . Length > 0 )
976+ {
977+ pngMetadata . HasTransparency = true ;
978+ }
976979 }
977980
978981 /// <summary>
0 commit comments