Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Changes from 1 commit
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
bc6e367
Allow to store metadata in png files
Xarthisius Oct 25, 2016
5200aff
Ensure that metadata pointer is initially set to NULL
Xarthisius Oct 25, 2016
5a5bd96
Allow to pass custom infoDict to images created with pdf backend
Xarthisius Oct 25, 2016
d8cac23
Allow to pass custom metadata to png images created with agg backend
Xarthisius Oct 25, 2016
8305868
Allow to pass custom Creator to images created with ps backend
Xarthisius Oct 25, 2016
0d814e0
'Software' starts with capital letter as per PNG specification
Xarthisius Oct 25, 2016
112e38a
fix pep8 issue
Xarthisius Oct 25, 2016
0f006e3
Drop debug statements
Xarthisius Oct 25, 2016
12b0120
Preserve the default values of the metadata. Allow user to update if …
Xarthisius Oct 25, 2016
d75b068
Revert accidental changes and fix indentation
Xarthisius Oct 27, 2016
92bccd2
Handle unicode/bytes directly in the C extension
Xarthisius Oct 27, 2016
e174284
Use 'latin_1' encoding instead of ascii
Xarthisius Oct 29, 2016
af4c1d1
Fix numpydoc format issues
Xarthisius Oct 29, 2016
98b5587
Add example info dictionary
Xarthisius Oct 29, 2016
a2d2c37
Add a description for the 'metadata' keyword to the docstring
Xarthisius Oct 31, 2016
06ad9fb
Explicitly define 'metadata' kwarg in '_print_figure'
Xarthisius Oct 31, 2016
6916e77
Define 'metadata' as kwarg in _print_figure_tex for consistency
Xarthisius Oct 31, 2016
8bb0ae3
Use default value for invalid key instead of NULL
Xarthisius Oct 31, 2016
66f6e2d
Use OrderedDict for metadata
Xarthisius Nov 17, 2016
8897f0f
Add 'what is new' entry for metadata kwarg in matplotlib.pyplot.savefig
Xarthisius Nov 17, 2016
935e02f
Fix merge
Xarthisius Dec 25, 2016
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Use 'latin_1' encoding instead of ascii
  • Loading branch information
Xarthisius committed Dec 25, 2016
commit e174284396cdd82590dc33daf58350caa28b6531
4 changes: 2 additions & 2 deletions src/_png.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,7 @@ static PyObject *Py_write_png(PyObject *self, PyObject *args, PyObject *kwds)
text[meta_pos].compression = PNG_TEXT_COMPRESSION_NONE;
#if PY3K
if (PyUnicode_Check(meta_key)) {
PyObject *temp_key = PyUnicode_AsEncodedString(meta_key, "ASCII", "strict");
PyObject *temp_key = PyUnicode_AsEncodedString(meta_key, "latin_1", "strict");
if (temp_key != NULL) {
text[meta_pos].key = PyBytes_AsString(temp_key);
}
Expand All @@ -303,7 +303,7 @@ static PyObject *Py_write_png(PyObject *self, PyObject *args, PyObject *kwds)
text[meta_pos].key = NULL; // Silently drops entry
}
if (PyUnicode_Check(meta_val)) {
PyObject *temp_val = PyUnicode_AsEncodedString(meta_val, "ASCII", "strict");
PyObject *temp_val = PyUnicode_AsEncodedString(meta_val, "latin_1", "strict");
if (temp_val != NULL) {
text[meta_pos].text = PyBytes_AsString(temp_val);
}
Expand Down