Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit e49947a

Browse filesBrowse files
authored
Merge pull request matplotlib#7796 from AdamWill/png-swap-endian
Only byte-swap 16-bit PNGs on little-endian (matplotlib#7792)
2 parents d181f63 + e96a2ca commit e49947a
Copy full SHA for e49947a

File tree

Expand file treeCollapse file tree

1 file changed

+2
-0
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+2
-0
lines changed

‎src/_png.cpp

Copy file name to clipboardExpand all lines: src/_png.cpp
+2Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -532,10 +532,12 @@ static PyObject *_read_png(PyObject *filein, bool float_result)
532532
png_set_shift(png_ptr, sig_bit);
533533
}
534534

535+
#if NPY_BYTE_ORDER == NPY_LITTLE_ENDIAN
535536
// Convert big endian to little
536537
if (bit_depth == 16) {
537538
png_set_swap(png_ptr);
538539
}
540+
#endif
539541

540542
// Convert palletes to full RGB
541543
if (png_get_color_type(png_ptr, info_ptr) == PNG_COLOR_TYPE_PALETTE) {

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.