question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Image is blank when taking picture of a big size view

See original GitHub issue

feature request

bug report

The image is not working properly when capturing an 8000 by 4000 view. The content of the image is blank.

Version & Platform

2.5.0

npm ls react-native react-native-view-shot #<- PASTE CMD RESULT IN HERE

Platform: iOS

Expected behavior

Be able to see the content of the 8000 by 4000 view

Actual behavior

Image is blank

Steps to reproduce the behavior

const styles = StyleSheet.create({
  multipleImageWrapper: {
    position: 'absolute',
    bottom: 0,
    top: Dimensions.get('window').height + 5,
  },
  flex: {
    flex: 1,
    backgroundColor: 'red',
  },
  fullImage: {
    width: '100%',
    height: '100%',
  },
});

<View
      collapsable={false}
      style={[styles.multipleImageWrapper, {width: 4000, height: 8000}]}
      ref={ref}
    >
      {images.map((image, i) => (
        <View key={`${i}`} style={styles.flex}>
          <Image
            resizeMode="cover"
            source={{
              uri: image,
            }}
            style={styles.fullImage}
          />
        </View>
      ))}
    </View>

Issue Analytics

  • State:open
  • Created a year ago
  • Comments:11

github_iconTop GitHub Comments

1reaction
tomaseliasmcommented, Jul 21, 2022

hi! same here, any workaround?

I was able to capture a long image using the option useRenderInContext

0reactions
israel-dvcommented, Sep 1, 2022

@tomaseliasm I can see that in the documentation, but in the latest version 3.4.0 It doesn’t exists. This is the interface to CaptureOptions

export interface CaptureOptions {
        /**
         * (number): the width and height of the final image (resized from the View bound. don't provide it if you want
         * the original pixel size).
         */
        width?: number;
        /**
         * @see {CaptureOptions#width}
         */
        height?: number;
        /**
         * either png or jpg or webm (Android). Defaults to png. raw is a ARGB array of image pixels.
         */
        format?: 'jpg' | 'png' | 'webm' | 'raw';
        /**
         * the quality. 0.0 - 1.0 (default). (only available on lossy formats like jpg)
         */
        quality?: number;
        /**
         * the method you want to use to save the snapshot, one of:
         " - tmpfile" (default): save to a temporary file (that will only exist for as long as the app is running).
         " - base64": encode as base64 and returns the raw string. Use only with small images as this may result of
         *   lags (the string is sent over the bridge). N.B. This is not a data uri, use data-uri instead.
         " - data-uri": same as base64 but also includes the Data URI scheme header.
         " - zip-base64: compress data with zip deflate algorithm and than convert to base64 and return as a raw string."
         */
        result?: 'tmpfile' | 'base64' | 'data-uri' | 'zip-base64';
        /**
         * if true and when view is a ScrollView, the "content container" height will be evaluated instead of the
         * container height.
         */
        snapshotContentContainer?: boolean;
    }

What version do you have ?

v3.3.0

Doesn’t exist

Read more comments on GitHub >

github_iconTop Results From Across the Web

Why are some of my pictures showing up as blank? - iFixit
Hi,. Just go to settings>apps>gallery then press the 3 dots on the right top and press uninstall updates, it will tell you that...
Read more >
Screen Black or photos fail to save when you attempt to take ...
If you attempt to take a photo and the screen is black, it means, barring the obvious that your device case is not...
Read more >
Photos App opens with blank / black screen
The app opens with a black screen (I have dark mode on). I have to close and reopen image then comes up. Files...
Read more >
Photos are loading as black boxes, empty boxes or broken ...
If you can't see photos on Facebook and you're seeing black boxes, empty boxes or broken images instead: Check if you have images...
Read more >
my photos are coming out as blank jpg thumbnails on my ipad?
so i just got my ipad today updated to IOS 11 and I noticed some of my photos are a blank grey thumbnail...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found