circulate icon indicating copy to clipboard operation
circulate copied to clipboard

Librarian view: Item image rotation issue

Open jim opened this issue 3 years ago • 3 comments

Describe the bug

On the Librarian view: The image for this item on the live site appears correctly on the edit photo page, but not on the item page or item index (e.g., https://app.chicagotoollibrary.org/items/13), where it's rotated 90 degrees. See screenshots below.

We're storing a rotation value in the database, but the output to the user is wrong. I'm assuming that something is happening with Imagekit- perhaps it is detecting some metadata in the original image and auto-rotating it?

Librarian view Screenshot 2021-08-31 193801

(User-facing) Item page view Screenshot 2021-08-31 193733

jim avatar Apr 17 '21 21:04 jim

Could you post a link to the image directly so it can be downloaded? I have a feeling it would be fixed by adding this CSS, but I can't test it

img {
  image-orientation: from-image;
}

pjsier avatar Sep 01 '21 12:09 pjsier

Here's the file as we serve it: https://ik.imagekit.io/sac4wk7wt3/d2tx8o0qr4z10i1idpj3vmpn4gnm?tr=w-600,h-600,c-at_max,rt-270

And here's the actual image: d2tx8o0qr4z10i1idpj3vmpn4gnm

We have some code that's supposed to store a user-provided rotation and apply it- that's where the rt-270 comes from. I don't know if the issue is that the rotation in the editing UI is broken, or if the way we display the file through ImageKit is the issue.

jim avatar Sep 03 '21 18:09 jim

Using that link above and changing the rt-270 to rt-0 fixes it in the browser by itself. Can't check the prod values that are shored for the url in prod. but it looks like the rotation value is attached to it.

jimnanney avatar Sep 24 '21 20:09 jimnanney