Skip to content
Closed
8 changes: 4 additions & 4 deletions IntegrationTests/ImageCachePolicyTest.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ class ImageCachePolicyTest extends React.Component<Props, $FlowFixMeState> {
<Text>Hello</Text>
<Image
source={{
uri: 'https://facebook.github.io/react/img/logo_small_2x.png?cacheBust=notinCache' + Date.now(),
uri: 'https://facebook.github.io/react-native/img/logo-small-2x.png?cacheBust=notinCache' + Date.now(),

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This image is not loading for me, either.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

These URLs won't work until are added to the website page (after merged the PR)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

If this were a simple website change, it would be alright as the website is versioned and the references to the new images will only go live once the images are deployed.

In this case, I think the images won't be visible on https://facebook.github.io/react-native/ for up to two months due to the way the website is deployed.

Let's first use existing images in the repo itself. Maybe update existing images instead, if that does not break anything unrelated?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

We could use this URL raw.githubusercontent.com/gusgard/react-native/correct-url-logo/website/src/react-native/img/logo-small.png that don't depend on the website. (changing user and branch for facebook and master).

Otherwise, I could use the images that are already in the img folder and test it well.

cache: 'only-if-cached'
}}
onLoad={() => this.testComplete('only-if-cached', false)}
Expand All @@ -74,7 +74,7 @@ class ImageCachePolicyTest extends React.Component<Props, $FlowFixMeState> {
/>
<Image
source={{
uri: 'https://facebook.github.io/react/img/logo_small_2x.png?cacheBust=notinCache' + Date.now(),
uri: 'https://facebook.github.io/react-native/img/logo-small-2x.png?cacheBust=notinCache' + Date.now(),
cache: 'default'
}}
onLoad={() => this.testComplete('default', true)}
Expand All @@ -83,7 +83,7 @@ class ImageCachePolicyTest extends React.Component<Props, $FlowFixMeState> {
/>
<Image
source={{
uri: 'https://facebook.github.io/react/img/logo_small_2x.png?cacheBust=notinCache' + Date.now(),
uri: 'https://facebook.github.io/react-native/img/logo-small-2x.png?cacheBust=notinCache' + Date.now(),
cache: 'reload'
}}
onLoad={() => this.testComplete('reload', true)}
Expand All @@ -92,7 +92,7 @@ class ImageCachePolicyTest extends React.Component<Props, $FlowFixMeState> {
/>
<Image
source={{
uri: 'https://facebook.github.io/react/img/logo_small_2x.png?cacheBust=notinCache' + Date.now(),
uri: 'https://facebook.github.io/react-native/img/logo-small-2x.png?cacheBust=notinCache' + Date.now(),
cache: 'force-cache'
}}
onLoad={() => this.testComplete('force-cache', true)}
Expand Down
2 changes: 1 addition & 1 deletion Libraries/Image/Image.android.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ function generateRequestId() {
* />
* <Image
* style={styles.logo}
* source={{uri: 'https://facebook.github.io/react/logo-og.png'}}
* source={{uri: 'https://facebook.github.io/react-native/img/logo-og.png'}}
* />
* </View>
* );
Expand Down
2 changes: 1 addition & 1 deletion Libraries/Image/Image.ios.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ const ImageViewManager = NativeModules.ImageViewManager;
* />
* <Image
* style={{width: 50, height: 50}}
* source={{uri: 'https://facebook.github.io/react/logo-og.png'}}
* source={{uri: 'https://facebook.github.io/react-native/img/logo-og.png'}}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This image is not loading for me. The opengraph image for RN is https://facebook.github.io/react-native/img/opengraph.png

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I prefer logo-og.png since the logo is in the center and has a dark background and all the examples in RNTester fit better, what do you think?

image

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Sounds good to me.

* />
* <Image
* style={{width: 66, height: 58}}
Expand Down
2 changes: 1 addition & 1 deletion Libraries/Image/ImageBackground.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ import type {NativeMethodsMixinType} from 'ReactNativeTypes';
* return (
* <ImageBackground
* style={{width: 50, height: 50}}
* source={{uri: 'https://facebook.github.io/react/logo-og.png'}}
* source={{uri: 'https://facebook.github.io/react-native/img/logo-og.png'}}
* >
* <Text>React</Text>
* </ImageBackground>
Expand Down
4 changes: 2 additions & 2 deletions RNTester/RNTesterUnitTests/RCTImageLoaderTests.m
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ - (void)testImageLoading

NS_VALID_UNTIL_END_OF_SCOPE RCTBridge *bridge = [[RCTBridge alloc] initWithBundleURL:_bundleURL moduleProvider:^{ return @[loader]; } launchOptions:nil];

NSURLRequest *urlRequest = [NSURLRequest requestWithURL:[NSURL URLWithString:@"https://facebook.github.io/react/logo-og.png"]];
NSURLRequest *urlRequest = [NSURLRequest requestWithURL:[NSURL URLWithString:@"https://facebook.github.io/react-native/img/logo-og.png"]];
[bridge.imageLoader loadImageWithURLRequest:urlRequest size:CGSizeMake(100, 100) scale:1.0 clipped:YES resizeMode:RCTResizeModeContain progressBlock:^(int64_t progress, int64_t total) {
XCTAssertEqual(progress, 1);
XCTAssertEqual(total, 1);
Expand Down Expand Up @@ -85,7 +85,7 @@ - (void)testImageLoaderUsesImageURLLoaderWithHighestPriority

NS_VALID_UNTIL_END_OF_SCOPE RCTBridge *bridge = [[RCTBridge alloc] initWithBundleURL:_bundleURL moduleProvider:^{ return @[loader1, loader2]; } launchOptions:nil];

NSURLRequest *urlRequest = [NSURLRequest requestWithURL:[NSURL URLWithString:@"https://facebook.github.io/react/logo-og.png"]];
NSURLRequest *urlRequest = [NSURLRequest requestWithURL:[NSURL URLWithString:@"https://facebook.github.io/react-native/img/logo-og.png"]];
[bridge.imageLoader loadImageWithURLRequest:urlRequest size:CGSizeMake(100, 100) scale:1.0 clipped:YES resizeMode:RCTResizeModeContain progressBlock:^(int64_t progress, int64_t total) {
XCTAssertEqual(progress, 1);
XCTAssertEqual(total, 1);
Expand Down
12 changes: 6 additions & 6 deletions RNTester/js/ImageExample.js
Original file line number Diff line number Diff line change
Expand Up @@ -195,9 +195,9 @@ var MultipleSourcesExample = createReactClass({
<Image
style={{flex: 1}}
source={[
{uri: 'https://facebook.github.io/react/img/logo_small.png', width: 38, height: 38},
{uri: 'https://facebook.github.io/react/img/logo_small_2x.png', width: 76, height: 76},
{uri: 'https://facebook.github.io/react/logo-og.png', width: 400, height: 400}
{uri: 'https://facebook.github.io/react-native/img/logo-small.png', width: 38, height: 38},
{uri: 'https://facebook.github.io/react-native/img/logo-small-2x.png', width: 76, height: 76},
{uri: 'https://facebook.github.io/react-native/img/logo-og.png', width: 400, height: 400}
]}
/>
</View>
Expand Down Expand Up @@ -237,7 +237,7 @@ exports.examples = [
render: function() {
return (
<Image
source={{uri: 'https://facebook.github.io/react/logo-og.png'}}
source={fullImage}
style={styles.base}
/>
);
Expand Down Expand Up @@ -727,8 +727,8 @@ exports.examples = [
},
];

var fullImage = {uri: 'https://facebook.github.io/react/logo-og.png'};
var smallImage = {uri: 'https://facebook.github.io/react/img/logo_small_2x.png'};
var fullImage = {uri: 'https://facebook.github.io/react-native/img/logo-og.png'};
var smallImage = {uri: 'https://facebook.github.io/react-native/img/logo-small-2x.png'};

var styles = StyleSheet.create({
base: {
Expand Down
8 changes: 4 additions & 4 deletions docs/Images.md
Original file line number Diff line number Diff line change
Expand Up @@ -97,11 +97,11 @@ Many of the images you will display in your app will not be available at compile

```javascript
// GOOD
<Image source={{uri: 'https://facebook.github.io/react/logo-og.png'}}
<Image source={{uri: 'https://facebook.github.io/react-native/img/logo-og.png'}}
style={{width: 400, height: 400}} />

// BAD
<Image source={{uri: 'https://facebook.github.io/react/logo-og.png'}} />
<Image source={{uri: 'https://facebook.github.io/react-native/img/logo-og.png'}} />
```

### Network Requests for Images
Expand All @@ -110,7 +110,7 @@ Many of the images you will display in your app will not be available at compile

```javascript
<Image source={{
uri: 'https://facebook.github.io/react/logo-og.png',
uri: 'https://facebook.github.io/react-native/img/logo-og.png',
method: 'POST',
headers: {
Pragma: 'no-cache'
Expand Down Expand Up @@ -147,7 +147,7 @@ to a URL load request, no attempt is made to load the data from the originating
and the load is considered to have failed.

```javascript
<Image source={{uri: 'https://facebook.github.io/react/logo-og.png', cache: 'only-if-cached'}}
<Image source={{uri: 'https://facebook.github.io/react-native/img/logo-og.png', cache: 'only-if-cached'}}
style={{width: 400, height: 400}} />
```

Expand Down
Binary file added website/src/react-native/img/logo-og.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added website/src/react-native/img/logo-small-2x.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added website/src/react-native/img/logo-small.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.