mirror of
https://github.com/python-pillow/Pillow.git
synced 2025-04-09 03:44:13 +03:00
Fix setting of TIFF ExtraSamples tag.
- force cast ExtraSamples to a list. - fix calls to ImagingLibTiffSetField to include array length.
This commit is contained in:
parent
21459e9ab4
commit
aba7a34036
|
@ -1183,6 +1183,8 @@ def _save(im, fp, filename):
|
|||
atts = {}
|
||||
# bits per sample is a single short in the tiff directory, not a list.
|
||||
atts[BITSPERSAMPLE] = bits[0]
|
||||
if EXTRASAMPLES in ifd:
|
||||
atts[EXTRASAMPLES] = list(ifd[EXTRASAMPLES])
|
||||
# Merge the ones that we have with (optional) more bits from
|
||||
# the original file, e.g x,y resolution so that we can
|
||||
# save(load('')) == original file.
|
||||
|
|
4
encode.c
4
encode.c
|
@ -770,7 +770,7 @@ PyImaging_LibTiffEncoderNew(PyObject* self, PyObject* args)
|
|||
}
|
||||
status = ImagingLibTiffSetField(&encoder->state,
|
||||
(ttag_t) PyInt_AsLong(key),
|
||||
intav);
|
||||
len, intav);
|
||||
free(intav);
|
||||
}
|
||||
} else {
|
||||
|
@ -782,7 +782,7 @@ PyImaging_LibTiffEncoderNew(PyObject* self, PyObject* args)
|
|||
}
|
||||
status = ImagingLibTiffSetField(&encoder->state,
|
||||
(ttag_t) PyInt_AsLong(key),
|
||||
floatav);
|
||||
len, floatav);
|
||||
free(floatav);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user