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.

[iOs] Can not get stats of photo/video

See original GitHub issue

🐛 Bug Report

Since I upgraded react-native from 0.57.4 to 0.59.1 I cannot get stats from iOs files: Error: failed to stat path ph://9F983DBA-EC35-42B8-8773-B597CF782EDD/L0/001 because it does not exist or it is not a folder

To Reproduce

  const opts = {
    first: 200,
    assetType: 'All',
    groupTypes: 'ALL'
  };
      
CameraRoll.getPhotos(opts)
        .then((r) => {
          const { edges } = r;
          return new Promise((res, reject) => {
            edges.forEach((media) => {
            const { image: { uri } } = media.node;
            RNFetchBlob.fs.stat(uri).then((stats) => {
               Object.assign(media.node.image, { size: stats.size });
           }).catch((error) => console.log('error', error));
      });
            resolve(r);
          });
        });

Expected Behavior

Expected stats return informations

Code Example

Environment

React Native Environment Info: System: OS: macOS 10.14.3 CPU: (8) x64 Intel® Core™ i5-8259U CPU @ 2.30GHz Memory: 60.63 MB / 16.00 GB Shell: 5.3 - /bin/zsh Binaries: Node: 11.9.0 - /usr/local/bin/node Yarn: 1.13.0 - /usr/local/bin/yarn Watchman: 4.9.0 - /usr/local/bin/watchman IDEs: Android Studio: 3.3 AI-182.5107.16.33.5314842 Xcode: /undefined - /usr/bin/xcodebuild npmPackages: react: 16.8.4 => 16.8.4 react-native: 0.59.1 => 0.59.1

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

13reactions
airlasercommented, Apr 2, 2019

@robwalkerco my bad.

Where uri is a thing given by CameraRoll:

const appleId = uri.substring(5, 41);
const ext = isPhoto ? 'JPG' : 'MOV';
return `assets-library://asset/asset.${ext}?id=${appleId}&ext=${ext}`;

I hope that helps.

1reaction
sulagardecommented, Apr 2, 2019

@robwalkerco my bad.

Where uri is a thing given by CameraRoll:

const appleId = uri.substring(5, 41);
const ext = isPhoto ? 'JPG' : 'MOV';
return `assets-library://asset/asset.${ext}?id=${appleId}&ext=${ext}`;

I hope that helps.

Thank’s for help!. I did not try this way because I change the lib for iOs (react-native-image-crop-picker) but I keep it in mind for later.

Read more comments on GitHub >

github_iconTop Results From Across the Web

iPhone Camera Video Settings and Options Missing? 8 Ways ...
iPhone Camera Video Settings and Options Missing? 8 Ways to Fix · 1. End Ongoing Voice or Video Calls · 2. Record a...
Read more >
Use camera modes on your iPhone or iPad - Apple Support
You can choose from photo, video, time-lapse, slo-mo, square, Portrait, Cinematic, and pano modes. You can also take a photo while you record...
Read more >
iphone - Where to view photo and movie metadata on iOS
Neither of us could find a way to view the video information on the phone. Is there a way to view media information...
Read more >
8 Ways to Fix Video Or Other Modes Disappeared from ...
If your iPhone camera is malfunctioning or still not letting you record videos, it can be due to hardware failure. I'd suggest you...
Read more >
How to Remove Location Data from Photos & Videos You ...
The photos and videos you take with your iPhone contain bits of information, ... Hit "Done," and it will now say "No Location"...
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