Permalink
Browse files

Fix some PNG reading bugs. There still are likely more issues here.

  • Loading branch information...
1 parent b702f73 commit ddadafc15f698e410600958e3e070e0ae5e4d61f @jnicholl jnicholl committed Jun 12, 2012
Showing with 5 additions and 2 deletions.
  1. +5 −2 src/pngreader.cpp
View
7 src/pngreader.cpp
@@ -91,8 +91,11 @@ bool PNGReader::doRead()
png_set_palette_to_rgb(m_read);
png_set_tRNS_to_alpha(m_read);
png_set_bgr(m_read);
- //if (png_get_channels(m_read, m_info) < channels)
- // png_set_filler(m_read, 0xff, PNG_FILLER_AFTER);
+ png_set_expand(m_read);
+ png_set_strip_16(m_read);
+ png_set_gray_to_rgb(m_read);
+ if (png_get_channels(m_read, m_info) < channels)
+ png_set_filler(m_read, 0xff, PNG_FILLER_AFTER);
m_data = new unsigned char[m_width * m_height * channels];
m_stride = m_width * channels;

0 comments on commit ddadafc

Please sign in to comment.