def test_image_to_jpeg(self): self.pt.registerTransform(image_to_jpeg()) imgFile = open(input_file_path('logo.gif'), 'rb') data = imgFile.read() self.assertEqual(self.mimetypes_registry.classify(data), 'image/gif') data = self.pt.convertTo(target_mimetype='image/jpeg', orig=data) self.assertEqual(data.getMetadata()['mimetype'], 'image/jpeg')
def test_image_to_jpeg(self): self.pt.registerTransform(image_to_jpeg()) imgFile = open(input_file_path("logo.gif"), "rb") data = imgFile.read() self.failUnlessEqual(self.mimetypes_registry.classify(data), "image/gif") data = self.pt.convertTo(target_mimetype="image/jpeg", orig=data) self.failUnlessEqual(data.getMetadata()["mimetype"], "image/jpeg")
def test_image_to_jpeg(self): self.pt.registerTransform(image_to_jpeg()) imgFile = open(input_file_path('logo.gif'), 'rb') data = imgFile.read() self.assertEqual(self.mimetypes_registry.classify(data),'image/gif') data = self.pt.convertTo(target_mimetype='image/jpeg',orig=data) self.assertEqual(data.getMetadata()['mimetype'], 'image/jpeg')
def test_image_to_jpeg(self): self.assert_image_transformed(image_to_jpeg(), 'logo.gif', 'image/gif', 'image/jpeg')