BCLibraries / burns-exhibits

Hugo site for Burns Library exhibits
0 stars 1 forks source link

Portrait images in large image gallery #10

Open monahakk opened 5 years ago

monahakk commented 5 years ago

Is your feature request related to a problem? Please describe. All images currently show up in landscape format in the large image gallery, whether or not they were saved in a landscape orientation. See http://localhost:1313/harp-traditions-of-ireland/royal-portable-irish-harp/ as an example of the orientation being changed

Describe the solution you'd like I'd like to be able to display portrait images in a large gallery page (maybe with that orientation attribute you mentioned adding?)

Describe alternatives you've considered If that isn't possible, I'll just switch all those to narrative pages, but that still won't be a great solution.

Otterfan commented 5 years ago

I'm going to reclassify this as a bug, because something is definitely broken. Those harp images shouldn't be rotated into landscape.

Otterfan commented 5 years ago

So this is complicated.

The camera that took the rotated harp pictures store orientation information in their EXIF metadata. This data tells applications what orientation the camera was in when the picture was taken and lets the application displaying the image choose whether to rotate the image or not.

Unfortunately browsers can't agree on what to do with these images. Test the example page in Firefox and it works, because Firefox respects this orientation metadata and rotates the image accordingly.

Chrome doesn't rotate the image, leading to a broken display.

We'll have to figure out a way to strip EXIF metadata from images before we post them.

Otterfan commented 5 years ago

I just pushed a commit that creates optimized derivative images for thumbnails—reduces their dimensions and removes unnecessary EXIF metadata—and it is stripping the orientation metadata too.

This will at least make images show in the same orientation in Chrome and Firefox.

monahakk commented 5 years ago

So update on this-- it was showing the wrong orientation with me in Firefox as well, even before you stripped the orientation metadata. Since we decided this only impacts 3 images that were taken with a camera, I cropped all three of them enough that they are now showing up with the correct orientation.

So, the bug is not solved, but the problem is.