Comments (6)
Sounds good. I will definitely look into implementing RCTURLRequestHandler. Did not know it existed before this and I sounds like a feature we should support. Let me know if there is anything else I can help with.
from react-native-photos-framework.
Nice to hear! Feel free to reference this issue when that's merged in case someone searching for this kind of stuff to help put the pieces together
from react-native-photos-framework.
Hi!
Would be glad to help, but let me ask you:
How are you sending the image? Some custom ObjC-code I would guess?
If that's correct I guess you are loading the image with the imageloader defined in this library or by using the React Natives imageLoader that you can use via the bridge in native modules?
If that's the case this is only an extension in our imageLoader?
We could make the extension of course, but it would seem easier, I you already have custom ObjC-code to just load the desired image yourself using PhotoFramework, in the format you like and then send the bytes.
Enlighten me if you are using some RN-feature to send the actual image. Like if RN's XHR has the ability to post images loaded with RN.. Is that the case?
Sry if I'm confused. Would like to help, just need some more info.
from react-native-photos-framework.
I realized that my request doesn't make sense anymore, but I'll answer your questions anyway because I learned I few things which may be useful.
A) RN XHR can send binary "file" data from things that implement RCTURLRequestHandler interface. In fact, the RCTImageLoader implements it too (it seems) checking all available image loaders, (but it needs a recompress which is not ideal). If this library implemented the RCTURLRequestHandler directly, sending the "raw" file with XHR would be supported out of the box.
B) In our case we first use the RN ImageEditor to allow the user to crop the image (but at a fixed pretty high resolution...), ImageEditor uses the ImageLoader method which doesn't specify size, so max resolution will be used. It then places the cropped Image in ImageStore which implement both ImageLoader and RCTURLRequestHandler. We could send it with XHR directly using the ImageStore uri, but we also need to store the file locally so we have a piece of native code which writes the data to a file before sending it (using react-native-fetch-blob due to other reasons).
C) when we really need to load the full resolution image in a view (for example to do interactive crop/zoom preview), we should just set the style width/height as specified by the asset and it will get loaded (then put in a ScrollView or something).
I elaborated on some of this here wkh237/react-native-fetch-blob#218
from react-native-photos-framework.
@adbl Should we close this?
FYI: I'm implementing RCTURLRequestHandler at the moment. It will land next week. (I know you found another solution, but I still thought it made sense to implement the interface).
from react-native-photos-framework.
RCTURLRequestHandler implementation is now released under 1.0 on npm.
from react-native-photos-framework.
Related Issues (20)
- How to create asset of local image ? HOT 1
- Copy and Move assets from one album to another albums. HOT 1
- How to get the path of the videos ?
- Photos -[PHCompositeMediaResult isPlaceholder]
- A problem occurred configuring project ':react-native-fetch-blob'
- Not getting any media in android from this library , IOS working HOT 1
- Sometimes getting crashed in iOS and taking too much time to get albums
- Installation Error in react native 0.61.4
- ndefined symbols for architecture x86_64: HOT 3
- Sporadic Crash HOT 1
- How to get MimeType? HOT 2
- How to get video associated with live photo? HOT 1
- Error: Cannot find module 'plist' HOT 1
- XCTest/XCTest.h not found HOT 7
- Error on install: Attempt to change mapping for "otf" extension from "font/otf" to "font/opentype". HOT 1
- [ios] Categorizing Assets
- App crashes on start in production build
- RCTCameraRollRNPhotosFrameworkManager is undef
- Undefined symbols for architecture arm64
- album.getAssets() is returning all device assets HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from react-native-photos-framework.