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

Media - Add large and medium image sizes #18997

Merged
merged 10 commits into from
Jul 20, 2022
Merged

Conversation

geriux
Copy link
Contributor

@geriux geriux commented Jul 6, 2022

Related PRs:

This PR adds support for the large and medium sizes for images, this data is already available from both the REST API and XMLRPC but it is not stored until now. Having these images allows using a lower size within the editor which improves the performance once images are uploaded.

Now once an image is uploaded from the editor, it will use the large size if available, if not it will fall back to the medium size and if none are available it will use the full size. This change is done to the Gutenberg processors for the Image and Gallery block.

For test instructions and screencast please check the Gutenberg PR description.

Regression Notes

  1. Potential unintended areas of impact

It should only affect the Gutenberg editor media uploads.

  1. What I did to test those areas of impact (or what existing automated tests I relied on)

Manual testing:

  • Image uploads using the editor and the Image and Gallery block
  • Gutenberg processors uploading images and closing the editor
  1. What automated tests I added (or what prevented me from doing so)

None, we do manual testing with media uploads from the editor.

PR submission checklist:

  • I have completed the Regression Notes.
  • I have considered adding unit tests for my changes.
  • I have considered adding accessibility improvements for my changes.
  • I have considered if this change warrants user-facing release notes and have added them to RELEASE-NOTES.txt if necessary.

@geriux geriux added Media Gutenberg Editing and display of Gutenberg blocks. labels Jul 6, 2022
@peril-wordpress-mobile
Copy link

peril-wordpress-mobile bot commented Jul 6, 2022

Warnings
⚠️ PR has more than 500 lines of code changing. Consider splitting into smaller PRs if possible.

Generated by 🚫 dangerJS

Podfile Outdated
# pod 'WordPressKit', :git => 'https://github.com/wordpress-mobile/WordPressKit-iOS.git', :tag => ''
# pod 'WordPressKit', :git => 'https://github.com/wordpress-mobile/WordPressKit-iOS.git', :branch => ''
# pod 'WordPressKit', :git => 'https://github.com/wordpress-mobile/WordPressKit-iOS.git', :commit => ''
pod 'WordPressKit', :git => 'https://github.com/wordpress-mobile/WordPressKit-iOS.git', :commit => '9d9efb43c3f502e98cfbe26fdd8ed11e2a04f02e'
Copy link
Contributor

@wpmobilebot wpmobilebot Jul 6, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 Use the new Ruby 1.9 hash syntax.

@wpmobilebot
Copy link
Contributor

wpmobilebot commented Jul 6, 2022

You can test the changes in Jetpack from this Pull Request by:
  • Clicking here or scanning the QR code below to access App Center
  • Then installing the build number pr18997-016f67e on your iPhone

If you need access to App Center, please ask a maintainer to add you.

@wpmobilebot
Copy link
Contributor

wpmobilebot commented Jul 6, 2022

You can test the changes in WordPress from this Pull Request by:
  • Clicking here or scanning the QR code below to access App Center
  • Then installing the build number pr18997-016f67e on your iPhone

If you need access to App Center, please ask a maintainer to add you.

@geriux geriux force-pushed the add/media-large-medium-sizes branch from 4ca8ab9 to 4fefef4 Compare July 8, 2022 10:32
Gerardo added 2 commits July 8, 2022 15:56
@geriux geriux changed the title Media - Add large and medium sizes Media - Add large and medium image sizes Jul 12, 2022
@geriux geriux marked this pull request as ready for review July 12, 2022 13:13
@geriux geriux added this to the 20.4 milestone Jul 12, 2022
@geriux geriux requested a review from derekblank July 12, 2022 13:14
Copy link
Contributor

@derekblank derekblank left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was able to test and verify the steps following the Testing Instructions on WordPress/gutenberg#42178. LGTM! 🚀

@geriux
Copy link
Contributor Author

geriux commented Jul 14, 2022

Hey @twstokes 👋 I was wondering if you would have some spare time to check out this PR, we've tested it in different scenarios and it's working as expected so we are looking for someone with native experience to check the code changes this PR is introducing. You've also done a core data migration before in the project, and you've worked with the Gutenberg Mobile team with media upload issues, that's why I'm pinging you first. I just want to make sure I'm following the right steps and not missing anything for these kinds of changes.

Please let me know if you could check it out, if not that's ok, I could look for someone else, thank you in advance!

@twstokes
Copy link
Contributor

Hey @twstokes 👋 I was wondering if you would have some spare time to check out this PR, we've tested it in different scenarios and it's working as expected so we are looking for someone with native experience to check the code changes this PR is introducing. You've also done a core data migration before in the project, and you've worked with the Gutenberg Mobile team with media upload issues, that's why I'm pinging you first. I just want to make sure I'm following the right steps and not missing anything for these kinds of changes.

Please let me know if you could check it out, if not that's ok, I could look for someone else, thank you in advance!

👋 Hey @geriux! Will be glad to!

@twstokes twstokes self-requested a review July 14, 2022 13:34
Copy link
Contributor

@twstokes twstokes left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👋 @geriux! I've left some comments in the PR and observations below for your consideration. 🙇

I followed the testing steps here:

Simple Site

  • Test Case 1 with gallery block ✅
  • Test Case 1 with image block ✅
  • Test Case 2 with gallery block ✅
  • Test Case 2 with image block ✅

Self-hosted Site

  • Test Case 1 with gallery block ✅
  • Test Case 2 with image block ✅
  • Test Case 1 with image block ⚠️ - Switching to thumbnail caused the image to disappear (see video below)
Self-hosted.Image.mp4
  • Test Case 2 with gallery block ⚠️ - After the draft uploaded I went back to the gallery block and didn't see the Image Size option

Observations

  • The image size for an image inside a Gallery Block can be set, but then overridden when the setting is changed at the gallery level without warning. This is an edge case and I'm assuming it's already been considered. 👍

WordPress/Classes/Services/PostCoordinator.swift Outdated Show resolved Hide resolved
WordPress/Classes/Services/PostCoordinator.swift Outdated Show resolved Hide resolved
@geriux
Copy link
Contributor Author

geriux commented Jul 14, 2022

Thank you so much for testing and your feedback @twstokes 🙇 I'll work on addressing the issues and your comments.

@geriux
Copy link
Contributor Author

geriux commented Jul 18, 2022

Hey @twstokes 👋

Thank you for the feedback and for testing, I applied some of the suggestions and also fixed the issue related to the image disappearing when changing the size. Let me know if you can give it another review/test. Thanks again!

Copy link
Contributor

@twstokes twstokes left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👋 @geriux! I'm going to approve this PR so you can choose whether my comments below should be addressed now or later.

Self-hosted + thumbnail mode

I tested setting images to thumbnail mode on a self-hosted site and they no longer disappeared. ✅

However, I did notice that when changing the quality of a gallery on the self-hosted site sometimes not all of the thumbnails would change. (see attached video) You can see that the first image in the second row still looks sharp.

This also happened after all the images were done processing and the app had been idle for around a minute. The site did not have Jetpack connected, if that makes any difference.

Thumbnail.MP4

Self-hosted + image size option on a draft post

I had the same results here as last time.

Test Case 2 with gallery block ⚠️ - After the draft uploaded I went back to the gallery block and didn't see the Image Size option

@geriux
Copy link
Contributor Author

geriux commented Jul 19, 2022

Hey @twstokes thank you so much for testing again!

I see why you're getting that issue, since you're using a self-hosted site without probably the Gutenberg plugin activated, it's loading the older version of the Gallery block, which has a lower usage. I've tested these scenarios with the Gutenberg plugin and the newer version of the Gallery block (that has nested blocks) and its working correctly.

I'll merge this since these changes are based on the newest Gallery block.

Thanks again!

@geriux geriux merged commit 7b8c3b9 into trunk Jul 20, 2022
@geriux geriux deleted the add/media-large-medium-sizes branch July 20, 2022 17:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Gutenberg Editing and display of Gutenberg blocks. Media
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants