Skip to content
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

Gutenberg: Image added from Media Library appears low-res #35578

Closed
apeatling opened this issue Aug 19, 2019 · 10 comments
Closed

Gutenberg: Image added from Media Library appears low-res #35578

apeatling opened this issue Aug 19, 2019 · 10 comments
Labels
[Goal] Full Site Editing [Pri] High Address as soon as possible after BLOCKER issues [Type] Bug

Comments

@apeatling
Copy link
Member

apeatling commented Aug 19, 2019

via @ianstewart:

  1. Clicked Edit Header
  2. Added Image to header, from default images in Media Library, using Image, changed width to full, image appears to be low-res.
@apeatling apeatling added [Type] Bug [Goal] Full Site Editing [Pri] High Address as soon as possible after BLOCKER issues labels Aug 19, 2019
@Copons
Copy link
Contributor

Copons commented Aug 21, 2019

I've tried the same in the Page/Post Editor, and it happens there as well.
Switching to the code editor, I can see that the image URL has the ?w=640 query param added, and of course changing the image size from the dropdown in the block sidebar doesn't do anything.
I'm inclined to think this is caused by the same problem that causes #34969.

@mmtr
Copy link
Member

mmtr commented Aug 22, 2019

I'd say this is the expected behavior. There are some open issues in Gutenberg requesting some enhancements on how the block alignments affect the image sizes: WordPress/gutenberg#6131, WordPress/gutenberg#12044

Right now Gutenberg doesn't resize the image when changing the block alignment and delegates any responsibility of changing the image size to the user with the "Image Size" setting.

Screen Shot 2019-08-22 at 08 55 21

Note that that selector was is not working due to #34969, but we fixed it today (we needed to revert the fix).

@Copons
Copy link
Contributor

Copons commented Aug 22, 2019

Thanks for looking into this @mmtr!
I'll keep the issue open until a fix for #34969 is merged, and we can test again to see if the UX gets any better. 👍

@gwwar
Copy link
Contributor

gwwar commented Aug 27, 2019

#34969 (comment) looks like a fix landed. Please verify and close out if no action is needed.

@Copons
Copy link
Contributor

Copons commented Aug 27, 2019

I'm tempted to close this but at the same time I'd like a second opinion. (cc @kwight @mmtr)

Right now on WP.com I'm able to change the image size via the sidebar dropdown (which is the aforementioned fix), so in a sense the low-res issue can be easily solved by the user, by changing the image size to full width.

Though, there is an unexpected behaviour going on (possibly related to the Media Modal?).

When I insert an image, it's always inserted with the ?w=640 query param, and sized as "Large" in Gutenberg.
This is incorrect. My site's image sizes are:

  • Thumbnail: 150
  • Medium: 300
  • Large: 1024
  • Full: nd

There is no size set at 640 that I know of.
This is easily verifiable by observing the query param appended to the image URL while changing the image's size via the Gutenberg dropdown.

The fact that the image is inserted at 640 and defined as Large means that, to set it as "Large proper" (1024), one would need to change the size in the dropdown to anything else, and then back to Large.

So then again, this issue in fact... is not really solved.
The image is inserted at 640 instead of 1024, and stretching a 640 image full width would look low-res beyond any reasonable doubts, much more than stretching a 1024 image anyway.

I haven't located where the ?w=640 is set, but I'd argue that, since Gutenberg defaults the size to Large, we should have a way to insert them at ?w=1024 instead.

@mmtr
Copy link
Member

mmtr commented Aug 28, 2019

My site's image sizes are:

Thumbnail: 150
Medium: 300
Large: 1024
Full: nd

Can you clarify where these sizes are defined? Is something a user can set on a per site basis?

@mmtr
Copy link
Member

mmtr commented Aug 28, 2019

Thanks for that research @Copons. Definitely there is something wrong. If there is some kind of conflict between the expected sizes and the actual ones, it might be caused by the same issue I noted in #35822 (comment) we're currently investigating.

Let's leave this issue open until we finish the investigation there.

@Copons
Copy link
Contributor

Copons commented Aug 28, 2019

My site's image sizes are:
Thumbnail: 150
Medium: 300
Large: 1024
Full: nd

Can you clarify where these sizes are defined? Is something a user can set on a per site basis?

They are on a per-site basis, and can be set in wp-admin Settings > Media (wp-admin/options-media.php).
My sizes are the WP default.

@noahtallen
Copy link
Contributor

This is not an FSE-related issue, so I'll edit and punt from the sprint to reflect that.

@noahtallen noahtallen changed the title FSE: Image added from Media Library in header template appears low-res. Gutenberg: Image added from Media Library appears low-res Oct 9, 2019
@noahtallen
Copy link
Contributor

On second thought, I'm going to close this. Uploading a high res picture and changing gutenberg to show full resolution does seem to show the full resolution of the picture in editor and on front end.

I think if not respecting the user's settings for image loading is an issue, that should be created separately and is likely not a WordPress.com bug

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Goal] Full Site Editing [Pri] High Address as soon as possible after BLOCKER issues [Type] Bug
Projects
None yet
Development

No branches or pull requests

5 participants