diff --git a/Tests/test_imagecms.py b/Tests/test_imagecms.py index ee3a2b92e..1eac4ad5f 100644 --- a/Tests/test_imagecms.py +++ b/Tests/test_imagecms.py @@ -377,8 +377,11 @@ class TestImageCms(PillowTestCase): self.assertEqual(p.product_description, 'sRGB IEC61966-2-1 black scaled') self.assertEqual(p.product_manufacturer, '') - self.assertEqual( - p.product_model, 'IEC 61966-2-1 Default RGB Colour Space - sRGB') + + # p.product_model + result = self.assert_warning(DeprecationWarning, getattr, p, "product_model") + self.assertEqual(result, "IEC 61966-2-1 Default RGB Colour Space - sRGB") + self.assertEqual( p.profile_description, 'sRGB IEC61966-2-1 black scaled') self.assertEqual( diff --git a/docs/reference/ImageCms.rst b/docs/reference/ImageCms.rst index 35f4acee6..ea6334708 100644 --- a/docs/reference/ImageCms.rst +++ b/docs/reference/ImageCms.rst @@ -132,21 +132,21 @@ can be easily displayed in a chromaticity diagram, for example). .. py:attribute:: manufacturer - The (english) display string for the device manufacturer (see + The (English) display string for the device manufacturer (see 9.2.22 of ICC.1:2010). :type: :py:class:`unicode` or ``None`` .. py:attribute:: model - The (english) display string for the device model of the device + The (English) display string for the device model of the device for which this profile is created (see 9.2.23 of ICC.1:2010). :type: :py:class:`unicode` or ``None`` .. py:attribute:: profile_description - The (english) display string for the profile description (see + The (English) display string for the profile description (see 9.2.41 of ICC.1:2010). :type: :py:class:`unicode` or ``None`` @@ -269,14 +269,14 @@ can be easily displayed in a chromaticity diagram, for example). .. py:attribute:: viewing_condition - The (english) display string for the viewing conditions (see + The (English) display string for the viewing conditions (see 9.2.48 of ICC.1:2010). :type: :py:class:`unicode` or ``None`` .. py:attribute:: screening_description - The (english) display string for the screening conditions. + The (English) display string for the screening conditions. This tag was available in ICC 3.2, but it is removed from version 4. diff --git a/src/PIL/ImageCms.py b/src/PIL/ImageCms.py index 29959a83a..ccb8aecf0 100644 --- a/src/PIL/ImageCms.py +++ b/src/PIL/ImageCms.py @@ -686,7 +686,7 @@ def getProfileName(profile): # // name was "%s - %s" (model, manufacturer) || Description , # // but if the Model and Manufacturer were the same or the model # // was long, Just the model, in 1.x - model = profile.profile.product_model + model = profile.profile.model manufacturer = profile.profile.product_manufacturer if not (model or manufacturer): @@ -819,7 +819,7 @@ def getProfileModel(profile): # add an extra newline to preserve pyCMS compatibility if not isinstance(profile, ImageCmsProfile): profile = ImageCmsProfile(profile) - return profile.profile.product_model + "\n" + return profile.profile.model + "\n" except (AttributeError, IOError, TypeError, ValueError) as v: raise PyCMSError(v) diff --git a/src/_imagingcms.c b/src/_imagingcms.c index 51b987f8d..0def62e1b 100644 --- a/src/_imagingcms.c +++ b/src/_imagingcms.c @@ -981,6 +981,8 @@ cms_profile_getattr_product_description(CmsProfileObject* self, void* closure) static PyObject* cms_profile_getattr_product_model(CmsProfileObject* self, void* closure) { + PyErr_WarnEx(PyExc_DeprecationWarning, + "product_model is deprecated. Use Unicode model instead.", 1); return _profile_getattr(self, cmsInfoModel); }