Comments (14)
i met the same issue recently, which is wired , if i get image from camera ,the" resizeImage" function works fine , if i choose image from PHOTOLIBRARY, app crash.
from cordova-plugin-image-resizer.
Same here. Damn it. It works fine on IOS but not on Android! Here are the crash logs.
E/AndroidRuntime( 4183): FATAL EXCEPTION: pool-1-thread-2
E/AndroidRuntime( 4183): Process: com.myapp.android, PID: 4183
E/AndroidRuntime( 4183): java.lang.IllegalArgumentException: Found query in URI: file:///storage/emulated/0/Android/data/com.myapp.android/cache/IMG_20161120_204314.jpg?1479654794267
E/AndroidRuntime( 4183): at java.io.File.checkURI(File.java:235)
E/AndroidRuntime( 4183): at java.io.File.<init>(File.java:177)
E/AndroidRuntime( 4183): at com.raananw.ImageResizePlugin$ImageTools.getBitmap(ImageResizePlugin.java:102)
E/AndroidRuntime( 4183): at com.raananw.ImageResizePlugin$ResizeImage.run(ImageResizePlugin.java:197)
E/AndroidRuntime( 4183): at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112)
E/AndroidRuntime( 4183): at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587)
E/AndroidRuntime( 4183): at java.lang.Thread.run(Thread.java:841)
E/Sensors ( 822): Lightsensor values:49.000000
E/android.os.Debug( 822): !@Dumpstate > sdumpstate -k -t -z -d -o /data/log/dumpstate_app_error
E/Sensors ( 822): Lightsensor values:49.000000
E/libEGL ( 4183): call to OpenGL ES API with no current context (logged once per thread)
Will this ever be resolved, seeing that there is no activity on the repo. :(
from cordova-plugin-image-resizer.
I get all the new messages but haven't enough time to fix the stuff... if someone would like to write a bugfix and creates a pull request I will check and merge it.
from cordova-plugin-image-resizer.
@JoschkaSchulz I have no idea about objective c or java. Could you please fix this? Lots of people are dependent on this.
from cordova-plugin-image-resizer.
Found query in URI: file:///storage/emulated/0/Android/data/com.myapp.android/cache/IMG_20161120_204314.jpg?1479654794267
maybe call it without query string then?
btw, maybe i'm wrong, but you're not using the plugin provided by this repository (com.raananw.ImageResizePlugin
vs. info.protonet.imageresizer.ImageResizer
). Maybe you should call the author of com.raananw.ImageResizePlugin
for action.
from cordova-plugin-image-resizer.
Both these repositories are similar. I have tried it with both the plugins. It throws the same error.
Could you elaborate on what do you mean by "without query"? Do you mean to just remove ?1479654794267
? Or something else?
BTW, I am not appending any query to the path. It is what Cordova camera plugin provides by default.
May be I will check the path that is provided by camera and gallery and I will update
from cordova-plugin-image-resizer.
@salzig OMG!!! It was due to the query string. I removed query string and it worked! 👍
If anyone comes here, please look at this. Here is the solution:
Here is the file path that is provided by Cordova when an image is chosen by gallery:
file:///storage/emulated/0/Android/data/com.app.ios/cache/IMG_20161122_124728.jpg?1083017394
You got to remove the query string ?1083017394
else, your app will crash.
var imagePath = file:///storage/emulated/0/Android/data/com.app.ios/cache/IMG_20161122_124728.jpg?1083017394;
if(imagePath.indexOf("?") > 0) {
imagePath = imagePath.trim().split("?")[0];
}
And then provide this imagePath
to the window.imageResizer.resizeImage
function.
from cordova-plugin-image-resizer.
@srameshr have you even tried this plugin? info.protonet.imageresizer.ImageResizer
(They are similar, but not the same)
As I can see, this exception only happens in RaananW/PhoneGap-Image-Resizer/.../ImageResizePlugin.java#L102 cause their are not using FileHelper.getInputStreamFromUriString
provided here: org.apache.cordova.camera.FileHelper
(with the same 'remove query'-hack used internally).
This helper is used in this repo (see: ImageResizer.java#L95. So your issue should not happen with this plugin.
from cordova-plugin-image-resizer.
Then why are people who are using this plugin seems to be raising the same issue. As in this thread.
from cordova-plugin-image-resizer.
I'm not sure if this is the same issue like yours. Maybe @eliaweiss could provide a stracktrace?
from cordova-plugin-image-resizer.
@LAandreas
Either way, the plugin fails when you try to upload an image from gallery.
from cordova-plugin-image-resizer.
@srameshr thats guessing, not knowing. Your problem happens cause of a different source code.
would be cool if @eliaweiss or @twainyoung could provide a stacktrace.
from cordova-plugin-image-resizer.
Would like to see a Stack trace for that Project, then I can maybe invest some time to write a fix.
from cordova-plugin-image-resizer.
@salzig True. PS: @eliaweiss @twainyoung
from cordova-plugin-image-resizer.
Related Issues (20)
- Please add the fileName(String) option for IOS too. Currently it only supports android and windows HOT 2
- Image proportion HOT 2
- Unable to create compressed file in Android Oreo (8.0) HOT 13
- Mismatch in ID/Package name causing double addition of plugin to package.json HOT 2
- Build failing (Unknown property `ANDROID_EXIFINTERFACES_VERSION`) HOT 18
- Nested FolderName throwing exception HOT 2
- fileName parameter on iOS does not work the way it is documented? HOT 7
- Always execute the error function
- Build failure HOT 4
- Short on Time HOT 1
- build failed Could not find exifinterface.jar HOT 4
- Failed to resize an image on iOS 12.x HOT 1
- Android giving black background for transparent Images HOT 1
- Failed to fetch plugin HOT 5
- IOS gives back an empty base64 string
- Version 0.2 isn't avaliable in NPM HOT 3
- base64: true not work in Android, returns file:/// uri scheme HOT 4
- Anyone got this working using cordova-plugin-camera-preview
- Code executes synchronously. Android HOT 2
- rotating camera captured photo by -90 degree and when selected from galary HOT 1
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 cordova-plugin-image-resizer.