DemocracyClub / yournextrepresentative

👥 A website for crowd-sourcing structured election candidate data
https://candidates.democracyclub.org.uk
GNU Affero General Public License v3.0
21 stars 27 forks source link

Rotated thumbnail doesn't match rotated image to edit #1846

Open edent opened 2 years ago

edent commented 2 years ago

Issue and Steps to Reproduce

Some photos appear rotated in full view, but not thumbnail. This may be related to #1009

Example https://candidates.democracyclub.org.uk/moderation/photo/review/29242

Screenshots

Correct rotation in thumbnail

Screenshot 2022-04-07 at 22-22-36 Uploaded photos for review

Incorrect rotation in edit view

Screenshot 2022-04-07 at 22-22-16 Review and crop the photo

Expected

Photos are rotated correctly

Actual

Additional Details

jf1 commented 2 years ago

I still think this is a failing in the library used by the cropping system when it reads the EXIF data as it's so similar to an issue that got fixed elsewhere, detailed here https://github.com/mysociety/yournextrepresentative/issues/286#issuecomment-299868996

Some more examples from this year: https://candidates.democracyclub.org.uk/moderation/photo/review/29080 https://candidates.democracyclub.org.uk/moderation/photo/review/29106 https://candidates.democracyclub.org.uk/moderation/photo/review/29156 https://candidates.democracyclub.org.uk/moderation/photo/review/29173 https://candidates.democracyclub.org.uk/moderation/photo/review/29175 https://candidates.democracyclub.org.uk/moderation/photo/review/29187 https://candidates.democracyclub.org.uk/moderation/photo/review/29242 https://candidates.democracyclub.org.uk/moderation/photo/review/29256 https://candidates.democracyclub.org.uk/moderation/photo/review/29273 https://candidates.democracyclub.org.uk/moderation/photo/review/29278 https://candidates.democracyclub.org.uk/moderation/photo/review/29287 https://candidates.democracyclub.org.uk/moderation/photo/review/29303 https://candidates.democracyclub.org.uk/moderation/photo/review/29308 https://candidates.democracyclub.org.uk/moderation/photo/review/29322

jf1 commented 2 years ago

This year I encountered one that was rotated 180 https://candidates.democracyclub.org.uk/moderation/photo/review/30102

And this is the first I'm aware of this year where the crop was misplaced - I think the x/y of the image's and cropper's locations get flipped, so it crops in the wrong places (and I wonder if you fix this then maybe any other workarounds could be removed) https://candidates.democracyclub.org.uk/moderation/photo/review/30519

If you upload the second example to the staging server can the issue be reproduced?

jf1 commented 2 years ago

@VirginiaDooley do you have a Photo Moderation tag for issues like this and #1868? I know they're related but to me uploading and moderating are two separate systems / workflows.

One way to address these two issues could be to add rotate and zoom buttons to the cropping interface, if that's practical, but I suspect always getting the EXIF right (it's always ok across the rest of the site) and enlarging the cropping area would be more sensible.

VirginiaDooley commented 2 years ago

1868

Not at the moment, but I can suggest to the team.

I think we know where this bug is happening; it's just a matter of time and priority with other work. It's really helpful to have this input and comparing the issues logged. We will try to get to it ASAP.