Re: Proposal: Make it so when getting an image's dimensions, EXIF orientation is considered

2022-10-29 Thread Adam Taylor
What about having a setting that is used in the django/core/files/images.py file's get_image_dimensions function? Something like IMAGE_DIMENSIONS_USES_EXIF. It could default to False at first to maintain backwards compatibility and eventually could be True by default. If the setting is set to T

Re: Proposal: Make it so when getting an image's dimensions, EXIF orientation is considered

2022-09-28 Thread David Sanders
Hi Adam, Sorry to clarify I was referring to `ImageFile` which has 2 `@property` attributes `width` and `height` [1]. My suggestion was that you could add 2 additional `@property` attributes that work with EXIF rotation 🙂 (or something along these lines…) [1] https://github.com/django/django/bl

Re: Proposal: Make it so when getting an image's dimensions, EXIF orientation is considered

2022-09-27 Thread 'Adam Johnson' via Django developers (Contributions to Django itself)
To have extra properties, we'd need to add extra database fields. It would be somewhat wasteful to add them to all ImageFields when few users will care about the difference. On Mon, Sep 26, 2022 at 10:28 AM David Sanders wrote: > Actually might as well throw out one idea, feel free to discard: >

Re: Proposal: Make it so when getting an image's dimensions, EXIF orientation is considered

2022-09-26 Thread David Sanders
Actually might as well throw out one idea, feel free to discard: Keep width and height as-is and add 2 additional properties for jpg: `photo_width` and `photo_height` (or named something more suitable) This way it stays inline with other image viewing/editing software which still reports the widt

Re: Proposal: Make it so when getting an image's dimensions, EXIF orientation is considered

2022-09-26 Thread David Sanders
Coincidence I was also just reading up image-orientation… I didn't realise that it's the default behaviour now to orient. I guess it's a question of whether/how to be backwards compatible? On Mon, 26 Sept 2022 at 19:00, 'Adam Johnson' via Django developers (Contributions to Django itself) wrote:

Re: Proposal: Make it so when getting an image's dimensions, EXIF orientation is considered

2022-09-26 Thread 'Adam Johnson' via Django developers (Contributions to Django itself)
I’m +1 to making this change. Incorrect orientation is frustrating and this is why browsers changed to always consider it (by default). You're right that the web default is to consider EXIF orientation data, controllable with the image-orientation CSS property: https://developer.mozilla.org/en-US/

Proposal: Make it so when getting an image's dimensions, EXIF orientation is considered

2022-09-24 Thread Adam Taylor
Following the advice of David Sanders and Mariusz Felisiak, I'm coming here with my proposal rather than continuing on with the ticket system (see ticket #34035 ). I understand the reluctance to make this change. However, things change with web brows