-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Editor: drag-n-drop upload can show incorrect rotation until upload is complete #318
Comments
Cheers all :)
This would work for images of small size, but potentially large images will slow rendering performance to a debilitating state. I did some preliminary testing on this, and if a temporary canvas element is used (just as how TinyMCE does
Note: for small images (in which the data URI is of acceptable length), As @aduth mentioned, I would go with the first solution instead:
Note: different orientations will behave similarly, but their transformation will be different. If the above sounds good, I'm ready to tackle it. |
Hey @krisk ! Thanks for taking a look at this. I think the path you outlined should be a reasonably simple approach, unforeseen complications notwithstanding. A few other items to consider, which may or may not affect the intended direction:
I was disappointed to see that there's been little progress in browser support for In a related note, I had already drafted a response before realizing that there's two issues with image rotation, the other concerning generated thumbnails on Jetpack sites (#313). The text below applies only to #313, but in case it overlaps or is otherwise in scope of what you're looking at, may be useful: It's been some time since my original observations, so I think it'd be good to take a moment and clarify the circumstances in which this is an issue. For example, does this affect both Jetpack and WordPress.com sites? Where are the images rotated incorrectly: modal? featured image sidebar? featured image header? post content? front-end? I seem to recall Photon playing a role in whether the image would be rotated. If I recall correctly, this is because when WordPress generates thumbnails from an image, it strips the EXIF metadata tags, but when a Photon-ized image is rendered, it regenerates an appropriately resized image from the original with metadata intact. Keep in mind that Photon is always in use on WordPress.com, but is a module that can be toggled on-and-off for a Jetpack site. I've been using some of the images from this repository (and insight from the related blog post) in testing: https://github.com/recurser/exif-orientation-examples |
I investigated this a bit and the following is possible, though I would argue not really worth it for the added complexity since this only affects transient images:
If the image is large enough, we may run into the case where generating the thumbnail is more work than the actual upload. I wonder if it would be enough to add a simple text or image placeholder for images we detect that have orientation set. This also won't work for images uploaded from urls that are from a different origin. |
@rralian Checking in on the progress here — is there a relate pull request, does it need help along (testing, review)? |
Re-ping @rralian I know things are busy — could you pass to someone else if you can't get to this one soon? It's a high priority issue. |
I missed the previous pings about this and didn't realize this was still assigned to me. Sorry, I believe I was in the throes of planning Automated Transfer at the time and things got a little crazy. I'm not actively working on this, and it's probably not going to be on my team's list anytime soon as this is a transient issues that's annoying, but not a showstopper level bug. So I've un-assigned myself in case someone else is able to take it. |
Going to punt this one — low priority. We can pick it up later if we get requests for it when talking to customers. |
Raised by @nickmomrik
What I Did: Dragged a portrait-oriented image into the editor.
What I Expected: To see it displayed portrait.
What Actually Happened: It first showed up sideways while uploading, then when completed it refreshed and displayed correctly.
I'm using Firefox on a Mac.
Example screencast https://cloudup.com/c-ERYMHtjSY and I'm attaching the image used.
/hat tip nickmomrik for the original report
Notes from @aduth
The text was updated successfully, but these errors were encountered: