Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(100)  |  Call(100)  |  Derive(0)  |  Import(0)

src/d/j/django-daguerre-2.1.1/daguerre/tests/unit/test_adjustments.py   django-daguerre(Download)
    def test_adjust__both(self):
        im = Image.open(self._data_path('100x100.png'))
        fit = Fit(width=50, height=50)
        adjusted = fit.adjust(im)
        self.assertEqual(adjusted.size, (50, 50))
        expected = Image.open(self._data_path('50x50_fit.png'))
        self.assertImageEqual(adjusted, expected)
 
    def test_adjust__width(self):
        im = Image.open(self._data_path('100x100.png'))
        adjusted = fit.adjust(im)
        self.assertEqual(adjusted.size, (50, 50))
        expected = Image.open(self._data_path('50x50_fit.png'))
        self.assertImageEqual(adjusted, expected)
 
    def test_adjust__height(self):
        im = Image.open(self._data_path('100x100.png'))

src/d/j/django-daguerre-HEAD/daguerre/tests/unit/test_adjustments.py   django-daguerre(Download)
    def test_adjust__both(self):
        im = Image.open(self._data_path('100x100.png'))
        fit = Fit(width=50, height=50)
        adjusted = fit.adjust(im)
        self.assertEqual(adjusted.size, (50, 50))
        expected = Image.open(self._data_path('50x50_fit.png'))
        self.assertImageEqual(adjusted, expected)
 
    def test_adjust__width(self):
        im = Image.open(self._data_path('100x100.png'))
        adjusted = fit.adjust(im)
        self.assertEqual(adjusted.size, (50, 50))
        expected = Image.open(self._data_path('50x50_fit.png'))
        self.assertImageEqual(adjusted, expected)
 
    def test_adjust__height(self):
        im = Image.open(self._data_path('100x100.png'))

src/d/j/django-daguerre-2.1.1/daguerre/tests/unit/test_utils.py   django-daguerre(Download)
 
        """
        image = Image.open(self._data_path('100x100.png'))
        self.assertIn(image.format, KEEP_FORMATS)
 
 
        """
        image = Image.open(self._data_path('100x50.psd'))
        self.assertNotIn(image.format, KEEP_FORMATS)
 
    def test_exif(self):
        image = Image.open(self._data_path('20x7_exif_rotated.jpg'))
        orientation = get_exif_orientation(image)
        self.assertEqual(orientation, 6)
 
    def test_non_exif(self):
        "get_exif_orientation should return None if there is no Exif data."
        image = Image.open(self._data_path('20x7_no_exif.png'))
    def test_exif_rotated(self):
        image = Image.open(self._data_path('20x7_exif_rotated.jpg'))
        image = apply_exif_orientation(image)
        self.assertEqual(image.size, self.ROTATED_ORIENTATION)
 

src/d/j/django-daguerre-HEAD/daguerre/tests/unit/test_utils.py   django-daguerre(Download)
 
        """
        image = Image.open(self._data_path('100x100.png'))
        self.assertIn(image.format, KEEP_FORMATS)
 
 
        """
        image = Image.open(self._data_path('100x50.psd'))
        self.assertNotIn(image.format, KEEP_FORMATS)
 
    def test_exif(self):
        image = Image.open(self._data_path('20x7_exif_rotated.jpg'))
        orientation = get_exif_orientation(image)
        self.assertEqual(orientation, 6)
 
    def test_non_exif(self):
        "get_exif_orientation should return None if there is no Exif data."
        image = Image.open(self._data_path('20x7_no_exif.png'))
    def test_exif_rotated(self):
        image = Image.open(self._data_path('20x7_exif_rotated.jpg'))
        image = apply_exif_orientation(image)
        self.assertEqual(image.size, self.ROTATED_ORIENTATION)