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

docs: fix incorrect information about webp support in the source prop of React Native's Image component #4240

Merged

Conversation

muhammadashfaq
Copy link
Contributor

Summary:
This PR corrects the misinformation regarding webp image format support in the source prop of React Native's Image component documentation. The current description incorrectly states that webp is only available when bundled with JavaScript on iOS, which is inaccurate.

Changes:

  • Updated the Image component's source prop description to accurately reflect the platform support for webp format.
  • Clarified that webp is supported on Android by default and on iOS when using libraries like react-native-webp or SDWebImage.

Impact:
This correction ensures that developers are provided with accurate information regarding image format support across platforms, helping avoid confusion and potential implementation errors.

@facebook-github-bot
Copy link

Hi @muhammadashfaq!

Thank you for your pull request and welcome to our community.

Action Required

In order to merge any pull request (code, docs, etc.), we require contributors to sign our Contributor License Agreement, and we don't seem to have one on file for you.

Process

In order for us to review and merge your suggested changes, please sign at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need to sign the corporate CLA.

Once the CLA is signed, our tooling will perform checks and validations. Afterwards, the pull request will be tagged with CLA signed. The tagging process may take up to 1 hour after signing. Please give it that time before contacting us about it.

If you have received this in error or have any questions, please contact us at cla@meta.com. Thanks!

Copy link

netlify bot commented Oct 1, 2024

Deploy Preview for react-native ready!

Name Link
🔨 Latest commit ae96ef3
🔍 Latest deploy log https://app.netlify.com/sites/react-native/deploys/6704f96eb0646f000886594d
😎 Deploy Preview https://deploy-preview-4240--react-native.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@muhammadashfaq muhammadashfaq changed the title Fix incorrect information about webp support in the source prop of React Native's Image component docs fix incorrect information about webp support in the source prop of React Native's Image component Oct 2, 2024
@muhammadashfaq muhammadashfaq changed the title docs fix incorrect information about webp support in the source prop of React Native's Image component docs: fix incorrect information about webp support in the source prop of React Native's Image component Oct 2, 2024
@muhammadashfaq muhammadashfaq marked this pull request as draft October 2, 2024 10:41
@muhammadashfaq muhammadashfaq marked this pull request as ready for review October 2, 2024 10:42
@muhammadashfaq
Copy link
Contributor Author

@cortinico

docs/image.md Outdated
@@ -419,7 +419,7 @@ The image source (either a remote URL or a local file resource).

This prop can also contain several remote URLs, specified together with their width and height and potentially with scale/other URI arguments. The native side will then choose the best `uri` to display based on the measured size of the image container. A `cache` property can be added to control how networked request interacts with the local cache. (For more information see [Cache Control for Images](images#cache-control-ios-only)).

The currently supported formats are `png`, `jpg`, `jpeg`, `bmp`, `gif`, `webp`, `psd` (iOS only). In addition, iOS supports several RAW image formats. Refer to Apple's documentation for the current list of supported camera models (for iOS 12, see https://support.apple.com/en-ca/HT208967).
The currently supported formats are `png`, `jpg`, `jpeg`, `bmp`, `gif`,`webp` (Android only), `psd` (iOS only). In addition, iOS supports several RAW image formats.`webp` format is supported on iOS only when bundled with the JavaScript code. Refer to Apple's documentation for the current list of supported camera models (for iOS 12, see https://support.apple.com/en-ca/HT208967).
Copy link
Contributor

Choose a reason for hiding this comment

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

webp format is supported on iOS only when bundled with the JavaScript code

Where is this coming from? Do you have a code reference from React Native or a GitHub issue for reference?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@cortinico
Github Issue is opened.
#4165

Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
The currently supported formats are `png`, `jpg`, `jpeg`, `bmp`, `gif`,`webp` (Android only), `psd` (iOS only). In addition, iOS supports several RAW image formats.`webp` format is supported on iOS only when bundled with the JavaScript code. Refer to Apple's documentation for the current list of supported camera models (for iOS 12, see https://support.apple.com/en-ca/HT208967).
The currently supported formats are `png`, `jpg`, `jpeg`, `bmp`, `gif`,`webp`, `psd` (iOS only). In addition, iOS supports several RAW image formats. Refer to Apple's documentation for the current list of supported camera models (for iOS 12, see https://support.apple.com/en-ca/HT208967).

Copy link
Contributor

Choose a reason for hiding this comment

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

And let's add a separate paragraph about webp below please

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sure @cortinico

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@cortinico added as a paragraph. Please take a look. Thanks

docs/image.md Outdated Show resolved Hide resolved
docs/image.md Outdated Show resolved Hide resolved
@cortinico cortinico merged commit 933e4fc into facebook:main Oct 8, 2024
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants