flutter_map_vector_tiles icon indicating copy to clipboard operation
flutter_map_vector_tiles copied to clipboard

Exception: Invalid image data

Open saugatshakya opened this issue 2 years ago • 4 comments

Exception: Invalid image data E/FlutterJNI(10380): Failed to decode image E/FlutterJNI(10380): android.graphics.ImageDecoder$DecodeException: Failed to create image decoder with message 'unimplemented'Input contained an error. E/FlutterJNI(10380): at android.graphics.ImageDecoder.nCreate(Native Method) E/FlutterJNI(10380): at android.graphics.ImageDecoder.access$200(ImageDecoder.java:172) E/FlutterJNI(10380): at android.graphics.ImageDecoder$ByteBufferSource.createImageDecoder(ImageDecoder.java:242) E/FlutterJNI(10380): at android.graphics.ImageDecoder.decodeBitmapImpl(ImageDecoder.java:1870) E/FlutterJNI(10380): at android.graphics.ImageDecoder.decodeBitmap(ImageDecoder.java:1863) E/FlutterJNI(10380): at io.flutter.embedding.engine.FlutterJNI.decodeImage(FlutterJNI.java:524) Screenshot_1674807607

saugatshakya avatar Jan 27 '23 08:01 saugatshakya

Are you trying one of the examples or something else, in which case what is the url ?

ibrierley avatar Jan 27 '23 09:01 ibrierley

Yes, I am actually trying to work with my own tileprovider : http://124.41.237.68/import.building_polygon/{z}/{x}/{y}.pbf? It is map of Nepal, coordinates-->lat: 27.672237,lng 85.314906, which gave me : "Image source: encoded image bytes ImageCodecException: Failed to detect image file format using the file header. File header was [0x1a 0xdd 0xe4 0x6c 0x0a 0x17 0x69 0x6d 0x70 0x6f]." error so I tried following the example and provided mapbox tiles which is also not working, The url I am using for mapbox: https://api.mapbox.com/styles/v1/blintoblinto/cld4iw29q001401p4pg3bwgj7/tiles/256/{z}/{x}/{y}?access_token=pk.eyJ1IjoiYmxpbnRvYmxpbnRvIiwiYSI6ImNsY3RiNno1ZjBidnUzb3F0N3dvdDRnZngifQ.5-wQCxIY7BH_CRABEhpXcw , it is also giving me similar invalid image data error

saugatshakya avatar Jan 27 '23 09:01 saugatshakya

I can't get those URLs to load (so they won't get that far), so can't test those currently.

It's worth being aware of vector tiles at https://github.com/greensopinion/flutter-vector-map-tiles which is a lot more complete and tested, and maybe worth using that if you have problems.

I'd also migrated some of my stuff to a test at https://github.com/ibrierley/geojson_vector_slicer which does a lot more other stuff, but I haven't redone some of the core vector stuff, that was more of an after thought, but I'll try and help anyone get on with that if the others don't work.

ibrierley avatar Jan 27 '23 14:01 ibrierley

I am prefer using your plugin over flutter_vector_map_tiles because flutter_vector_map_tiles is harder to setup with all the styles and all and It's even harder when you have your own tile provider. I'll try using your another package(geojson_vector_slicer). Thanks for the quick replies, I am a real fan of your work :) (y)

saugatshakya avatar Jan 28 '23 08:01 saugatshakya