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

All Samples(8)  |  Call(6)  |  Derive(0)  |  Import(2)

src/d/j/django-daguerre-2.1.1/daguerre/tests/unit/test_utils.py   django-daguerre(Download)
 
from daguerre.tests.base import BaseTestCase
from daguerre.utils import (make_hash, save_image, get_exif_orientation,
    get_image_dimensions, apply_exif_orientation, exif_aware_size,
    DEFAULT_FORMAT, KEEP_FORMATS)
    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)
 
    def test_exif_not_rotated(self):
        "If rotation tag is 0, no rotation should be applied."
        image = Image.open(self._data_path('20x7_exif_not_rotated.jpg'))
        image = apply_exif_orientation(image)
    def test_non_exif(self):
        "If no exif data is present the original image should be left intact."
        original_image = Image.open(self._data_path('20x7_no_exif.png'))
        image = apply_exif_orientation(original_image)
        self.assertImageEqual(image, original_image)

src/d/j/django-daguerre-HEAD/daguerre/tests/unit/test_utils.py   django-daguerre(Download)
 
from daguerre.tests.base import BaseTestCase
from daguerre.utils import (make_hash, save_image, get_exif_orientation,
    get_image_dimensions, apply_exif_orientation, exif_aware_size,
    DEFAULT_FORMAT, KEEP_FORMATS)
    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)
 
    def test_exif_not_rotated(self):
        "If rotation tag is 0, no rotation should be applied."
        image = Image.open(self._data_path('20x7_exif_not_rotated.jpg'))
        image = apply_exif_orientation(image)
    def test_non_exif(self):
        "If no exif data is present the original image should be left intact."
        original_image = Image.open(self._data_path('20x7_no_exif.png'))
        image = apply_exif_orientation(original_image)
        self.assertImageEqual(image, original_image)