ComputerScienceHouse / ComputerScienceHouse/gallery
Images arent always displayed in the correct orientation when viewing an image
- Vorherrschende Sprache
- Python
- Sterne
- 22
- Forks
- 30
- Ø Merge
- 2 Std. 26 Min.
- Gemergte PRs (30 T.)
- 1
Beschreibung
When viewing images taken vertically (i.e. https://gallery.csh.rit.edu/view/file/36582), [some browsers](https://caniuse.com/#search=image-orientation) (i.e. new versions of firefox) correctly rotate the image based on its EXIF metadata, however, most browsers (i.e. chromium) still display it incorrectly.
in order to fix this for other browsers, there needs to be a fallback for when the `image-orientation` CSS property is not supported.
So far i've come up with:
1. Since #45 seems to be rotating thumbnails server-side, maybe we could also rotate the images server-side before displaying them, however, it seems like the `/api/files/get` endpoint is just [returning a link to s3](https://github.com/ComputerScienceHouse/gallery/blob/773b30fab2bfac69e6ac7573dc4954d0192fbcf5/gallery/__init__.py#L751), so this might be a pretty complicated way to do it.
2. alternatively, maybe we could implement the rotation using CSS classes and have the `view_file.html` template look at the metadata and decide which to use
Beitragsleitfaden
Für dieses Repository ist kein Beitragsleitfaden indexiert
Rechercherichtung
Start with the view_file.html template and the /api/files/get path in gallery/__init__.py around line 751, then compare the thumbnail rotation approach discussed in issue #45. Determine how image orientation metadata can be handled for browsers without image-orientation support. Done means vertically taken images display in the correct orientation across the affected browsers.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- css, python
- Bereich
- backend, frontend
- Issue-Typ
- Bug
- Schwierigkeit
- 4/5
- Geschätzter Aufwand
- 3-5 Tage
- Aktivitätsstatus
- Veraltet
- Klarheit
- Größtenteils klar
- Anfängerfreundlichkeit
- 35/100