File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -1065,14 +1065,14 @@ PyFile::write(const char* outfilename)
10651065
10661066 Header header;
10671067
1068- if (P.name ().empty () && parts.size () > 1 )
1068+ if (!P.name ().empty ())
1069+ header.setName (P.name ());
1070+ else if (parts.size () > 1 )
10691071 {
10701072 std::stringstream n;
10711073 n << " Part" << part_index;
10721074 header.setName (n.str ());
10731075 }
1074- else
1075- header.setName (P.name ());
10761076
10771077 //
10781078 // Add attributes from the py::dict to the output header
Original file line number Diff line number Diff line change @@ -324,6 +324,8 @@ def test_write_half(self):
324324 # Verify reading it back gives the same data
325325 with OpenEXR .File (outfilename , separate_channels = True ) as infile :
326326 compare_files (infile , outfile )
327+ if "name" in infile .header ():
328+ raise Exception (f"name attribute was added to single part half file" )
327329
328330 os .remove (outfilename )
329331
You can’t perform that action at this time.
0 commit comments