GithubHelp home page GithubHelp logo

andreavitale / av.imageview Goto Github PK

View Code? Open in Web Editor NEW
96.0 96.0 29.0 186.33 MB

Titanium native ImageView module that extends the default Titanium ImageView with more capabilities and a different caching system.

License: MIT License

JavaScript 0.12% Objective-C 90.41% Python 0.30% Java 0.78% C 8.39%
android appcelerator appcelerator-titanium images imageview ios native titanium titanium-mobile titanium-module

av.imageview's People

Contributors

andreavitale avatar bduyng avatar brianggalvez avatar gaspardle avatar hansemannn avatar jormagar avatar leoafarias avatar m1ga avatar phobeous avatar prashantsaini1 avatar rlustemberg avatar topener avatar tvpsoft avatar yazany6b avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

av.imageview's Issues

[iOS] GIFs not loading properly when in a listview.

We are having an issue on iOS were GIFs are not having the proper behavior. Often, they will not load until scrolled past and then back to multiple times. Working GIFs will also disappear when scrolled past and then back to.

how to catch load or error events

can you explain how events work?
I'm trying this

$.image.addEventListener('load', function(){
	alert('done');
});

and this

$.image.on('load', function(){
	alert('done');
});

then the app crash

OutOfMemory on Android

The images load great, and the module also seems to fix problems with images not loading properly sometimes.. but problem is on Android where the app seems to go out of memory very soon.

I do load a great amount of images in my app. Any suggestions on how I can overcome this?

I also have images inside scrollable view. Would it be possible not to load these images when they are not scrolled to (i.e. the module having a manual load method which I could invoke, and a creation option like autoLoad: false to prevent the initial load)?

Module throwing am OutOfMemoryError with multiple GIF images

First of all; thanks for this great module! Works perfect with images. Butttt, with GIF there are still some issues, also with latest version.

We've got a listView with 20-40 GIF images. After some seconds testing, an out of memory error is generated.

I tried to add largeHeap="true" to the manifest, but no effect.

This is my console output (maybe not all part of the error, but you get the idea:

[INFO] :   art: Starting a blocking GC Alloc
[INFO] :   art: Starting a blocking GC Alloc
[INFO] :   art: Alloc sticky concurrent mark sweep GC freed 963(23KB) AllocSpace objects, 0(0B) LOS objects, 2%% free, 93MB/96MB, paused 204us total 10.952ms
[INFO] :   art: Starting a blocking GC Alloc
[WARN] :   cr_ScreenOrientation: Removing an inexistent observer!
[ERROR] :  chromium: [ERROR:gles2_cmd_decoder.cc(2167)] [.CommandBufferContext.RenderCompositor-0xc0334840]GL ERROR :GL_INVALID_OPERATION : BackFramebuffer::Destroy: <- error from previous GL command
[INFO] :   art: Waiting for a blocking GC Alloc
[INFO] :   art: Clamp target GC heap from 105MB to 96MB
[INFO] :   art: Alloc partial concurrent mark sweep GC freed 744(87KB) AllocSpace objects, 1(4MB) LOS objects, 6%% free, 89MB/96MB, paused 505us total 144.816ms
[INFO] :   art: Starting a blocking GC Alloc
[INFO] :   art: Waiting for a blocking GC Alloc
[INFO] :   art: Clamp target GC heap from 105MB to 96MB
[INFO] :   art: Alloc concurrent mark sweep GC freed 270(13KB) AllocSpace objects, 0(0B) LOS objects, 6%% free, 89MB/96MB, paused 368us total 26.521ms
[INFO] :   art: Forcing collection of SoftReferences for 16MB allocation
[INFO] :   art: Starting a blocking GC Alloc
[INFO] :   art: Waiting for a blocking GC Alloc
[INFO] :   art: Clamp target GC heap from 105MB to 96MB
[INFO] :   art: Alloc concurrent mark sweep GC freed 77(2480B) AllocSpace objects, 0(0B) LOS objects, 6%% free, 89MB/96MB, paused 399us total 27.166ms
[WARN] :   art: Throwing OutOfMemoryError "Failed to allocate a 16777228 byte allocation with 6909008 free bytes and 6MB until OOM"
[INFO] :   art: WaitForGcToComplete blocked for 83.008ms for cause Alloc
[INFO] :   art: Starting a blocking GC Alloc
[INFO] :   art: Starting a blocking GC Alloc
[INFO] :   art: Waiting for a blocking GC Alloc
[INFO] :   art: Alloc sticky concurrent mark sweep GC freed 4(544B) AllocSpace objects, 0(0B) LOS objects, 6%% free, 89MB/96MB, paused 355us total 5.751ms
[INFO] :   art: Starting a blocking GC Alloc
[INFO] :   art: Waiting for a blocking GC Alloc
[INFO] :   art: Clamp target GC heap from 105MB to 96MB
[INFO] :   art: Alloc partial concurrent mark sweep GC freed 7(168B) AllocSpace objects, 0(0B) LOS objects, 6%% free, 89MB/96MB, paused 262us total 27.285ms
[INFO] :   art: Starting a blocking GC Alloc
[INFO] :   art: Waiting for a blocking GC Alloc
[INFO] :   art: Clamp target GC heap from 105MB to 96MB
[INFO] :   art: Alloc concurrent mark sweep GC freed 38(1176B) AllocSpace objects, 0(0B) LOS objects, 6%% free, 89MB/96MB, paused 393us total 35.050ms
[INFO] :   art: Forcing collection of SoftReferences for 16MB allocation
[INFO] :   art: Starting a blocking GC Alloc
[INFO] :   art: Waiting for a blocking GC Alloc
[INFO] :   art: Clamp target GC heap from 105MB to 96MB
[INFO] :   art: Alloc concurrent mark sweep GC freed 16(496B) AllocSpace objects, 0(0B) LOS objects, 6%% free, 89MB/96MB, paused 290us total 22.315ms
[WARN] :   art: Throwing OutOfMemoryError "Failed to allocate a 16777228 byte allocation with 6904784 free bytes and 6MB until OOM"
[INFO] :   art: Starting a blocking GC Alloc
[INFO] :   art: Starting a blocking GC Alloc
[INFO] :   art: Waiting for a blocking GC Alloc
[INFO] :   art: Starting a blocking GC Alloc
[INFO] :   art: Waiting for a blocking GC Alloc
[INFO] :   art: Clamp target GC heap from 105MB to 96MB
[INFO] :   art: Alloc partial concurrent mark sweep GC freed 15(400B) AllocSpace objects, 0(0B) LOS objects, 6%% free, 89MB/96MB, paused 246us total 17.623ms
[INFO] :   art: WaitForGcToComplete blocked for 112.097ms for cause Alloc
[INFO] :   art: Starting a blocking GC Alloc
[INFO] :   art: Starting a blocking GC Alloc
[INFO] :   art: Waiting for a blocking GC Alloc
[INFO] :   art: Starting a blocking GC Alloc
[INFO] :   art: Waiting for a blocking GC Alloc
[INFO] :   art: Clamp target GC heap from 105MB to 96MB
[INFO] :   art: Alloc partial concurrent mark sweep GC freed 14(304B) AllocSpace objects, 0(0B) LOS objects, 6%% free, 89MB/96MB, paused 354us total 23.213ms
[INFO] :   art: Starting a blocking GC Alloc
[INFO] :   art: Waiting for a blocking GC Alloc
[INFO] :   art: Clamp target GC heap from 105MB to 96MB
[INFO] :   art: Alloc concurrent mark sweep GC freed 41(1320B) AllocSpace objects, 0(0B) LOS objects, 6%% free, 89MB/96MB, paused 526us total 78.072ms
[INFO] :   art: Forcing collection of SoftReferences for 16MB allocation
[INFO] :   art: Starting a blocking GC Alloc
[INFO] :   art: Waiting for a blocking GC Alloc
[INFO] :   art: Clamp target GC heap from 105MB to 96MB
[INFO] :   art: Alloc concurrent mark sweep GC freed 18(496B) AllocSpace objects, 0(0B) LOS objects, 6%% free, 89MB/96MB, paused 338us total 38.550ms
[INFO] :   art: Starting a blocking GC HomogeneousSpaceCompact
[INFO] :   art: Waiting for a blocking GC Alloc
[INFO] :   art: Clamp target GC heap from 105MB to 96MB
[INFO] :   art: HomogeneousSpaceCompact marksweep + semispace GC freed 4(96B) AllocSpace objects, 0(0B) LOS objects, 6%% free, 89MB/96MB, paused 49.731ms total 49.731ms
[WARN] :   art: Throwing OutOfMemoryError "Failed to allocate a 16777228 byte allocation with 6909336 free bytes and 6MB until OOM"
[INFO] :   art: WaitForGcToComplete blocked for 192.086ms for cause Alloc
[INFO] :   art: Starting a blocking GC Alloc
[INFO] :   art: Clamp target GC heap from 97MB to 96MB
[INFO] :   art: Alloc concurrent mark sweep GC freed 320(524KB) AllocSpace objects, 2(8MB) LOS objects, 15%% free, 81MB/96MB, paused 489us total 124.324ms
[INFO] :   art: Forcing collection of SoftReferences for 16MB allocation
[INFO] :   art: Starting a blocking GC Alloc
[WARN] :   AVImageView: (main) [850,483960] https://cdn.skoften.net/images/62496/gifdump_544_2.gif: resource not loaded.
[WARN] :   AVImageView: (main) [0,483960] java.lang.OutOfMemoryError: Failed to allocate a 16777228 byte allocation with 6909336 free bytes and 6MB until OOM
[INFO] :   art: Clamp target GC heap from 97MB to 96MB
[INFO] :   art: Alloc concurrent mark sweep GC freed 94(5KB) AllocSpace objects, 0(0B) LOS objects, 15%% free, 81MB/96MB, paused 280us total 29.370ms
[WARN] :   art: Throwing OutOfMemoryError "Failed to allocate a 16777228 byte allocation with 15311864 free bytes and 14MB until OOM"
[WARN] :   AVImageView: (main) [164,484124] https://cdn.skoften.net/images/62496/gifdump_544_1.gif: resource not loaded.
[WARN] :   AVImageView: (main) [0,484124] java.lang.OutOfMemoryError: Failed to allocate a 16777228 byte allocation with 15311864 free bytes and 14MB until OOM
[INFO] :   art: Starting a blocking GC Alloc
[INFO] :   art: Starting a blocking GC Alloc
[INFO] :   art: Alloc sticky concurrent mark sweep GC freed 7372(2MB) AllocSpace objects, 9(4MB) LOS objects, 10%% free, 85MB/96MB, paused 897us total 16.346ms
[INFO] :   art: Starting a blocking GC Alloc
[INFO] :   art: Starting a blocking GC Alloc
[INFO] :   art: Clamp target GC heap from 98MB to 96MB
[INFO] :   art: Alloc partial concurrent mark sweep GC freed 2566(99KB) AllocSpace objects, 7(12MB) LOS objects, 14%% free, 82MB/96MB, paused 4.233ms total 101.425ms
[INFO] :   art: Starting a blocking GC Alloc
[INFO] :   art: Alloc sticky concurrent mark sweep GC freed 37(592B) AllocSpace objects, 0(0B) LOS objects, 14%% free, 82MB/96MB, paused 243us total 9.305ms
[INFO] :   art: Starting a blocking GC Alloc
[INFO] :   art: Clamp target GC heap from 98MB to 96MB
[INFO] :   art: Alloc concurrent mark sweep GC freed 192(9KB) AllocSpace objects, 2(776KB) LOS objects, 14%% free, 82MB/96MB, paused 288us total 78.797ms
[INFO] :   art: Forcing collection of SoftReferences for 16MB allocation
[INFO] :   art: Starting a blocking GC Alloc
[INFO] :   art: Clamp target GC heap from 99MB to 96MB
[INFO] :   art: Alloc concurrent mark sweep GC freed 91(3032B) AllocSpace objects, 1(1028KB) LOS objects, 13%% free, 83MB/96MB, paused 454us total 66.894ms
[WARN] :   art: Throwing OutOfMemoryError "Failed to allocate a 16777228 byte allocation with 13142064 free bytes and 12MB until OOM"
[INFO] :   art: Starting a blocking GC Alloc
[INFO] :   art: Starting a blocking GC Alloc
[WARN] :   art: Suspending all threads took: 7.013ms
[INFO] :   art: Alloc sticky concurrent mark sweep GC freed 24(1040B) AllocSpace objects, 0(0B) LOS objects, 13%% free, 83MB/96MB, paused 11.013ms total 22.080ms
[INFO] :   art: Starting a blocking GC Alloc
[INFO] :   art: Clamp target GC heap from 99MB to 96MB
[INFO] :   art: Alloc partial concurrent mark sweep GC freed 114(2632B) AllocSpace objects, 0(0B) LOS objects, 13%% free, 83MB/96MB, paused 474us total 66.827ms
[INFO] :   art: Starting a blocking GC Alloc
[WARN] :   GifResourceDecoder: Error reading data from stream
[WARN] :   GifResourceDecoder: java.io.InterruptedIOException: thread interrupted
[WARN] :   GifResourceDecoder: 	at com.android.okhttp.okio.Timeout.throwIfReached(Timeout.java:145)
[WARN] :   GifResourceDecoder: 	at com.android.okhttp.okio.Okio$2.read(Okio.java:133)
[WARN] :   GifResourceDecoder: 	at com.android.okhttp.okio.AsyncTimeout$2.read(AsyncTimeout.java:211)
[WARN] :   GifResourceDecoder: 	at com.android.okhttp.okio.RealBufferedSource.read(RealBufferedSource.java:50)
[WARN] :   GifResourceDecoder: 	at com.android.okhttp.internal.http.HttpConnection$FixedLengthSource.read(HttpConnection.java:418)
[WARN] :   GifResourceDecoder: 	at com.android.okhttp.okio.RealBufferedSource$1.read(RealBufferedSource.java:371)
[WARN] :   GifResourceDecoder: 	at java.io.FilterInputStream.read(FilterInputStream.java:133)
[WARN] :   GifResourceDecoder: 	at com.bumptech.glide.util.ContentLengthInputStream.read(ContentLengthInputStream.java:65)
[WARN] :   GifResourceDecoder: 	at com.bumptech.glide.util.ContentLengthInputStream.read(ContentLengthInputStream.java:60)
[WARN] :   GifResourceDecoder: 	at com.bumptech.glide.load.resource.bitmap.RecyclableBufferedInputStream.fillbuf(RecyclableBufferedInputStream.java:132)
[WARN] :   GifResourceDecoder: 	at com.bumptech.glide.load.resource.bitmap.RecyclableBufferedInputStream.read(RecyclableBufferedInputStream.java:309)
[WARN] :   GifResourceDecoder: 	at java.io.FilterInputStream.read(FilterInputStream.java:107)
[WARN] :   GifResourceDecoder: 	at com.bumptech.glide.load.resource.gif.GifResourceDecoder.inputStreamToBytes(GifResourceDecoder.java:105)
[WARN] :   GifResourceDecoder: 	at com.bumptech.glide.load.resource.gif.GifResourceDecoder.decode(GifResourceDecoder.java:57)
[WARN] :   GifResourceDecoder: 	at com.bumptech.glide.load.resource.gif.GifResourceDecoder.decode(GifResourceDecoder.java:26)
[WARN] :   GifResourceDecoder: 	at com.bumptech.glide.load.resource.gifbitmap.GifBitmapWrapperResourceDecoder.decodeGifWrapper(GifBitmapWrapperResourceDecoder.java:101)
[WARN] :   GifResourceDecoder: 	at com.bumptech.glide.load.resource.gifbitmap.GifBitmapWrapperResourceDecoder.decodeStream(GifBitmapWrapperResourceDecoder.java:87)
[WARN] :   GifResourceDecoder: 	at com.bumptech.glide.load.resource.gifbitmap.GifBitmapWrapperResourceDecoder.decode(GifBitmapWrapperResourceDecoder.java:71)
[WARN] :   GifResourceDecoder: 	at com.bumptech.glide.load.resource.gifbitmap.GifBitmapWrapperResourceDecoder.decode(GifBitmapWrapperResourceDecoder.java:61)
[WARN] :   GifResourceDecoder: 	at com.bumptech.glide.load.resource.gifbitmap.GifBitmapWrapperResourceDecoder.decode(GifBitmapWrapperResourceDecoder.java:22)
[WARN] :   GifResourceDecoder: 	at com.bumptech.glide.load.engine.DecodeJob.decodeFromSourceData(DecodeJob.java:190)
[WARN] :   GifResourceDecoder: 	at com.bumptech.glide.load.engine.DecodeJob.decodeSource(DecodeJob.java:177)
[WARN] :   GifResourceDecoder: 	at com.bumptech.glide.load.engine.DecodeJob.decodeFromSource(DecodeJob.java:128)
[WARN] :   GifResourceDecoder: 	at com.bumptech.glide.load.engine.EngineRunnable.decodeFromSource(EngineRunnable.java:127)
[WARN] :   GifResourceDecoder: 	at com.bumptech.glide.load.engine.EngineRunnable.decode(EngineRunnable.java:106)
[WARN] :   GifResourceDecoder: 	at com.bumptech.glide.load.engine.EngineRunnable.run(EngineRunnable.java:58)
[WARN] :   GifResourceDecoder: 	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:428)
[WARN] :   GifResourceDecoder: 	at java.util.concurrent.FutureTask.run(FutureTask.java:237)
[WARN] :   GifResourceDecoder: 	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1133)
[WARN] :   GifResourceDecoder: 	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:607)
[WARN] :   GifResourceDecoder: 	at java.lang.Thread.run(Thread.java:761)
[WARN] :   GifResourceDecoder: 	at com.bumptech.glide.load.engine.executor.FifoPriorityThreadPoolExecutor$DefaultThreadFactory$1.run(FifoPriorityThreadPoolExecutor.java:118)
[INFO] :   art: Clamp target GC heap from 104MB to 96MB
[INFO] :   art: Alloc concurrent mark sweep GC freed 1350(168KB) AllocSpace objects, 1(2MB) LOS objects, 8%% free, 88MB/96MB, paused 363us total 99.082ms
[INFO] :   art: Forcing collection of SoftReferences for 16MB allocation
[INFO] :   art: Starting a blocking GC Alloc
[INFO] :   art: Clamp target GC heap from 97MB to 96MB
[INFO] :   art: Alloc concurrent mark sweep GC freed 874(1462KB) AllocSpace objects, 3(6MB) LOS objects, 15%% free, 81MB/96MB, paused 774us total 88.041ms
[WARN] :   art: Throwing OutOfMemoryError "Failed to allocate a 16777228 byte allocation with 15103648 free bytes and 14MB until OOM"
[WARN] :   AVImageView: (main) [6431,490555] https://cdn.skoften.net/images/62496/gifdump_544_3.gif: resource not loaded.
[WARN] :   AVImageView: (main) [0,490555] java.lang.OutOfMemoryError: Failed to allocate a 16777228 byte allocation with 15103648 free bytes and 14MB until OOM
[INFO] :   art: Starting a blocking GC Alloc
[INFO] :   art: Starting a blocking GC Alloc
[INFO] :   art: Alloc sticky concurrent mark sweep GC freed 1268(432KB) AllocSpace objects, 9(4MB) LOS objects, 10%% free, 85MB/96MB, paused 347us total 19.179ms
[INFO] :   art: Starting a blocking GC Alloc
[INFO] :   art: Starting a blocking GC Alloc
[INFO] :   art: Clamp target GC heap from 97MB to 96MB
[INFO] :   art: Alloc partial concurrent mark sweep GC freed 1302(50KB) AllocSpace objects, 3(12MB) LOS objects, 15%% free, 81MB/96MB, paused 300us total 28.471ms
[INFO] :   art: Starting a blocking GC Alloc
[INFO] :   art: Alloc sticky concurrent mark sweep GC freed 0(0B) AllocSpace objects, 0(0B) LOS objects, 15%% free, 81MB/96MB, paused 1.342ms total 5.005ms
[INFO] :   art: Starting a blocking GC Alloc
[INFO] :   art: Clamp target GC heap from 97MB to 96MB
[INFO] :   art: Alloc concurrent mark sweep GC freed 62(1880B) AllocSpace objects, 0(0B) LOS objects, 15%% free, 81MB/96MB, paused 306us total 29.922ms
[INFO] :   art: Forcing collection of SoftReferences for 16MB allocation
[INFO] :   art: Starting a blocking GC Alloc
[INFO] :   art: Clamp target GC heap from 97MB to 96MB
[INFO] :   art: Alloc concurrent mark sweep GC freed 50(1656B) AllocSpace objects, 0(0B) LOS objects, 15%% free, 81MB/96MB, paused 230us total 29.316ms
[WARN] :   art: Throwing OutOfMemoryError "Failed to allocate a 16777228 byte allocation with 15276416 free bytes and 14MB until OOM"
[INFO] :   art: Starting a blocking GC Alloc
[INFO] :   art: Starting a blocking GC Alloc
[INFO] :   art: Starting a blocking GC Alloc
[INFO] :   art: Clamp target GC heap from 97MB to 96MB
[INFO] :   art: Alloc partial concurrent mark sweep GC freed 15(400B) AllocSpace objects, 0(0B) LOS objects, 15%% free, 81MB/96MB, paused 299us total 19.571ms
[INFO] :   art: Starting a blocking GC Alloc
[INFO] :   art: Clamp target GC heap from 97MB to 96MB
[INFO] :   art: Alloc concurrent mark sweep GC freed 3(72B) AllocSpace objects, 0(0B) LOS objects, 15%% free, 81MB/96MB, paused 193us total 22.551ms
[INFO] :   art: Forcing collection of SoftReferences for 16MB allocation
[INFO] :   art: Starting a blocking GC Alloc
[INFO] :   art: Clamp target GC heap from 97MB to 96MB
[INFO] :   art: Alloc concurrent mark sweep GC freed 33(864B) AllocSpace objects, 0(0B) LOS objects, 15%% free, 81MB/96MB, paused 1.568ms total 27.834ms
[WARN] :   art: Throwing OutOfMemoryError "Failed to allocate a 16777228 byte allocation with 15271432 free bytes and 14MB until OOM"
[WARN] :   AVImageView: (main) [1169,491724] https://cdn.skoften.net/images/62496/gifdump_544_1.gif: resource not loaded.
[WARN] :   AVImageView: (main) [0,491724] java.lang.OutOfMemoryError: Failed to allocate a 16777228 byte allocation with 15271432 free bytes and 14MB until OOM

Android seems to lose the auth headers

Hi,

I use the module in a listview an after I scroll the requestHeader doesn't seem to be parsed anymore for some reason (I need auth).

UPDATE: more specific - it seems to lose the ones that are "below" the screen. So for the items that are visible the header is there, but for the ones that needs to be rendered it disappears.

Any idea?
Thank you.

BTW - this is a great module ๐Ÿ˜„

Android - Support Glide 4.x (e.g. 4.7.0)

We are using this library together with Ti.ImagePicker which uses Glide 4.7.0 (from April 2018). Unfortunately, this leads to incompatibility issues with this module, since this one still uses Glide 3.8.0. It looks like some classes have been moved in Glide 4.x (from May 2017), so migrating may take some effort.

multiple GIFs images in TableView cause freeze and crash

SDK: 6.1.0.GA
Platform: iOS

Before this module we used webviews to display (remote) GIFS in a tableView. Not very fast, but it worked. Multiple webviews (20-30) are loaded fine, eventually.

I tried to implement this module because we really need a proper solution for the populair GIF files, but unfortunately it doesn't work. Display a single GIF works, but when multiple GIFS are added to a tableView the tableView freezes during scrolling, and crashes after a few seconds. So I had to rollback the webView-contruction.

Screencast: https://streamable.com/xsxq9

PS. don't mind the cracks ;-]

Problems with SDK 7.0.0.GA

Im getting this error at the App launch: Any Help?

[ERROR] : TiApplication: (main) [13,921] Sending event: exception on thread: main msg:java.lang.UnsatisfiedLinkError: dalvik.system.PathClassLoader[DexPathList[[zip file "/data/app/com.moovin.app-1/base.apk"],nativeLibraryDirectories=[/data/app/com.moovin.app-1/lib/arm64, /data/app/com.moovin.app-1/base.apk!/lib/arm64-v8a, /system/lib64, /vendor/lib64, /system/vendor/lib64, /product/lib64]]] couldn't find "libav.imageview.so"; Titanium 7.0.1,2017/12/18 10:42,undefined

Seems like it's missing the lib for arm64-v8a

assets images

unable to load asset image
ex: "/images/[email protected]"

as well as image, defaultImage, brokenLinkImage

Titanium 5.5.1.GA

Any explanation ?

Android: setImage() keeps the old image

Trimmed version of my XML:

<Window>
  <ScrollableView>
  <View>
    <ImageView id="img_me" module="av.imageview"/>
    <ImageView id="img_me2"/>
  </View>
  <View></View>
  </ScrollableView>
</Window>
function updateUser(e) {
	$.img_me.setImage(imgName);
	$.img_me2.setImage(imgName);
}

I open a new window (edit) on top of this and call updateUser() once the user changes its profile picture (it will even have a new filename). When I close the edit-window and go back to the window with the two images the standard imageview will show the new image, the av.imageview will still show the old image which I even delete (imgName has the new name when I log it). When I reopen the edit-window it will show the new image there. The index window only changes the image when I reopen the whole app.

Setting enableMemoryCache:false doesn't change anything.

Versions
Android 7
Ti SDK 7.0.1
patched av.imageview (#37)

I'll check it with an older version to see if its a problem with ti7, still has to be fixed there if its a bug ๐Ÿ˜„

Please support blob

<ImageView id="photo" class="av-imageview" module="av.imageview"/>
$.photo.image = blob;

Pass blob to image property cause error

message = "Invalid type passed to function";
nativeLocation = "-[AvImageviewImageView setImage_:] (AvImageviewImageView.m:105)";
nativeReason = "expected: String, was: TiBlob";

thank you :)

Loading error

test.zip

When a remote photo is loading, if you set another local photo, it show the local photo, then the remote photo replace the local photo.

Steps to reproduce

  1. Use a slow network
  2. When the remote photo is loading
  3. Click Remove button, and the local photo show up
  4. When the remote photo is loaded, it replace the local photo

Thanks

Exposing cookie handling as an option. Using default user agent in requests

In order to access cookie authenticated images, it's necessary for the http requests to include cookies. In my particular user case we also use user agent validation, which I am resetting globally using another module.
Then we could use the module as this:

var AVImageview =  require('av.imageview');
createImageView({
        width: 100,
        height: 100,
        image: "https://static.pexels.com/photos/27954/pexels-photo-27954.jpg",
        requestHeader: {
            'Authorization': 'Bearer your_access_token_here'
        },
handleCookies: AVImageview.HANDLE_COOKIES
    });

There is another issue, which is that setImage_ is invoked before the http headers are set, I'll put the image handling code in the - (void)configurationSet method, to make sure that al properties are set before it's invoked. I'll submit a PR later today. This solution is iOS only.I don't know if av.imageview handles sessions on Android.

Problems with SDK 7.0.1.GA

Im getting this error at the App launch: Any Help?

[ERROR] : TiApplication: (main) [13,921] Sending event: exception on thread: main msg:java.lang.UnsatisfiedLinkError: dalvik.system.PathClassLoader[DexPathList[[zip file "/data/app/com.moovin.app-1/base.apk"],nativeLibraryDirectories=[/data/app/com.moovin.app-1/lib/arm64, /data/app/com.moovin.app-1/base.apk!/lib/arm64-v8a, /system/lib64, /vendor/lib64, /system/vendor/lib64, /product/lib64]]] couldn't find "libav.imageview.so"; Titanium 7.0.1,2017/12/18 10:42,undefined
[ERROR] : TiApplication: java.lang.UnsatisfiedLinkError: dalvik.system.PathClassLoader[DexPathList[[zip file "/data/app/com.moovin.app-1/base.apk"],nativeLibraryDirectories=[/data/app/com.moovin.app-1/lib/arm64, /data/app/com.moovin.app-1/base.apk!/lib/arm64-v8a, /system/lib64, /vendor/lib64, /system/vendor/lib64, /product/lib64]]] couldn't find "libav.imageview.so"
[ERROR] : TiApplication: at java.lang.Runtime.loadLibrary0(Runtime.java:989)
[ERROR] : TiApplication: at java.lang.System.loadLibrary(System.java:1533)
[ERROR] : TiApplication: at org.appcelerator.kroll.runtime.v8.V8Runtime.loadExternalModules(V8Runtime.java:151)
[ERROR] : TiApplication: at org.appcelerator.kroll.runtime.v8.V8Runtime.initRuntime(V8Runtime.java:118)
[ERROR] : TiApplication: at org.appcelerator.kroll.KrollRuntime.doInit(KrollRuntime.java:205)
[ERROR] : TiApplication: at org.appcelerator.kroll.KrollRuntime$KrollRuntimeThread.run(KrollRuntime.java:114)
[ERROR] : TiApplication: at org.appcelerator.kroll.KrollRuntime.init(KrollRuntime.java:136)
[ERROR] : TiApplication: at com.moovin.app.MoovinApplication.onCreate(MoovinApplication.java:79)
[ERROR] : TiApplication: at android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:1028)
[ERROR] : TiApplication: at android.app.ActivityThread.handleBindApplication(ActivityThread.java:5712)
[ERROR] : TiApplication: at android.app.ActivityThread.-wrap2(ActivityThread.java)
[ERROR] : TiApplication: at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1637)
[ERROR] : TiApplication: at android.os.Handler.dispatchMessage(Handler.java:105)
[ERROR] : TiApplication: at android.os.Looper.loop(Looper.java:156)
[ERROR] : TiApplication: at android.app.ActivityThread.main(ActivityThread.java:6577)
[ERROR] : TiApplication: at java.lang.reflect.Method.invoke(Native Method)
[ERROR] : TiApplication: at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:941)
[ERROR] : TiApplication: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:831)

Android: Widget with ImageView not showing up

Might be related to #16
I have a basic widget:

<Alloy>
	<View id="view_all">
		<ImageView id="image" module="av.imageview"/>
		<Label id="title"/>
	</View>
</Alloy>
"#view_all": {
	width:Ti.UI.FILL,
	height: Ti.UI.FILL,
	left:0,
	borderWidth: 1,
	borderColor: "#fff"
}

"#image":{
	left:0,
	height:80,
	width: Ti.UI.FILL,
	touchEnabled: false,
	contentMode: Alloy.Globals.CONTENT_MODE_FILL
}
"#title":{
	left: 10,
	top:10,
	color:"#fff"
}

and I create and include it into a TableView. On iOS the image shows up on Android it stays blank

Module not working with Titanium 7.0.0 GA

This module doesn't seem to work using the new Titanium 7.0.0 GA.

When I compile my app using the following:

$ appc build -p android

I get the following error:

[ERROR] Found incompatible Titanium Modules:
[ERROR]    id: av.imageview      version: 2.2.0  platform: android       min sdk: 6.0.0.GA
[ERROR]    id: av.imageview      version: 2.1.3  platform: android       min sdk: 6.0.0.GA
[ERROR]    id: av.imageview      version: 2.1.2  platform: android       min sdk: 6.0.0.GA
[ERROR]    id: av.imageview      version: 2.1.3  platform: android       min sdk: 6.0.0.GA
[ERROR]    id: av.imageview      version: 2.1.2  platform: android       min sdk: 6.0.0.GA

Note that it seems to work fine for older SDK versions such as 6.3.0GA.

I believe it just needs recompiling.

Can you please fix asap!

There's no way to remove an existing image or to clear the current image

I was working on an iOS app where I loaded an image from gallery but I also have an option to remove the picture if user wants to. I tried below codes but none of them working and it looks like it's not possible to remove the image. It's for iOS as I tested, not sure if it's the case with Android as well.

$.imageView.image = ''; and this one also didn't work : $.imageView.image = null;

Don't Know Where Else To Say This ...

So this is NOT a bug, but I don't see another place to leave feedback. Just wanted to tell the devs that this is one of the best Titanium modules I've ever ran across. So easy to implement, works so well even on Droid. Y'all did a fantastic job. I'd love to buy a beer for whoever is behind this if there's a way to do so.

Thanks again, and for supporting the Appcelerator Titanium community. You rock.

ContentMode aspectRatio

Hey there,

I got a missing contentMode like CONTENT_MODE_ASPECTRATIO where just one item (width or height) has to be given.

It would be awesome if you can add it.

"enableZoomControls" properties not working

Hi,

Really appreciate about your code. It help me very well.

But, I am facing one issue in it.
My project need image Zoom feature in it. But with your module, "enableZoomControls" properties are not working in it.

I am facing this issue in Android. I haven't check for iOS for PinchZoom.

AvImageView version 2.0.7 - Android
TiSDK version 6.0.1.GA.

Thank you.

Putting a blob right into this doesn't work like the native ImageView?

On my native image views sometimes I need to display a local file which is gotten in to the form of a blob. When I set this blob as the image on a native imageView it works fine, but on this one it doesn't seem to show anything.

Possible to add this?

Otherwise an incredible module that has saved me many headaches

Android - ImageView in ListView is not filling up the content in various cases.

On Android, if we use smaller dimension ImageView in ListView, then CONTENT_FILL is not taking effect.

I tried it with a simple ListView having an ImageView of width:90dp & height:90dp in ItemTemplate, then CONTENT_FILL property doesn't work.

I then increased dimensions of ImageView step-by-step & it worked correctly on w=129dp, height=129dp.

On smaller screen devices (<=4 inch), CONTENT_FILL also doesn't work even in larger ImageView.

See attached screenshot where backgroundColor : blue. Code used for those ImageViews is

<!-- alloy.js -->
var AvImageview = require("av.imageview");
Alloy.Globals.CONTENT_MODE_FIT = AvImageview.CONTENT_MODE_ASPECT_FIT;
Alloy.Globals.CONTENT_MODE_FILL = AvImageview.CONTENT_MODE_ASPECT_FILL;

<!-- XML -->
<ImageView bindId="itemImage" ns="AvImageview" class="item-image" />

<!-- tss -->
    left: 15,
    width:90,
    height:70,
    defaultImage: '/images/placeholder2.png',
    contentMode : Alloy.Globals.CONTENT_MODE_FILL,
    backgroundColor: 'blue'

Device Details: Moto G4 Play - Android 6.0.1 - 1280x720 - 5" screen

screenshot_20180112-220831

Android version wont install

installing the same as other modules (in the project or sdk home), module is not selectable in the list and doesnt load when manually adding it in tiapp.xml

Build fails on Android

Hey there!

Awesome module, thank you @AndreaVitale! We are using this module for iOS and it works fine. For Android, we get a build error about duplicate symbols:

[ERROR] Failed to run dexer:
[ERROR]
[ERROR] Uncaught translation error: java.lang.IllegalArgumentException: already added: Lokhttp3/package-info;
[ERROR] Uncaught translation error: java.lang.IllegalArgumentException: already added: Lokhttp3/Address;
[ERROR] Uncaught translation error: java.lang.IllegalArgumentException: already added: Lokhttp3/Authenticator;
[ERROR] Uncaught translation error: java.lang.IllegalArgumentException: already added: Lokhttp3/Authenticator$1;
[ERROR] Uncaught translation error: java.lang.IllegalArgumentException: already added: Lokhttp3/Cache;
[ERROR] Uncaught translation error: java.lang.IllegalArgumentException: already added: Lokhttp3/Cache$1;
[ERROR] Uncaught translation error: java.lang.IllegalArgumentException: already added: Lokhttp3/Cache$2;
[ERROR] Uncaught translation error: java.lang.IllegalArgumentException: already added: Lokhttp3/Cache$CacheRequestImpl;
[ERROR] Uncaught translation error: java.lang.IllegalArgumentException: already added: Lokhttp3/Cache$CacheRequestImpl$1;
[ERROR]
[ERROR] UNEXPECTED TOP-LEVEL EXCEPTION:
[ERROR] java.lang.RuntimeException: Translation has been interrupted
[ERROR]         at com.android.dx.command.dexer.Main.processAllFiles(Main.java:615)
[ERROR]         at com.android.dx.command.dexer.Main.runMultiDex(Main.java:368)
[ERROR]         at com.android.dx.command.dexer.Main.runDx(Main.java:289)
[ERROR]         at com.android.dx.command.dexer.Main.main(Main.java:247)
[ERROR]         at com.android.dx.command.Main.main(Main.java:94)
[ERROR] Caused by: java.lang.InterruptedException: Too many errors
[ERROR]         at com.android.dx.command.dexer.Main.processAllFiles(Main.java:607)
[ERROR]         ... 4 more

It looks like the okhttp library is causing the issue, which is also added by the SDK. Maybe it can be removed? Does someone use this module in 7.4.1.GA+?

Excesive memory usage

When adding remote images, the built in cache manager creates in memory cached data which is not cleared after the setter is called again. In time this could create a huge memory hog. In our use case, av.imageviews where loaded into a Listview. Very soon the app memory usage reaches passes the 1 GB.
Removing the in memory cache of the current image before it's changed solves the issue.
I'll create a PR for this

Can't update `image` on ListView

For some logic reason on my code I have to change the setting for image property to controller after I fetch my data from API.

this is my binding property: logo:image='/images/defaultImage.png'

on my controller I get all items of my section and then set the image on item.logo.image = myImage;

function getImagesAndCache(){

  $.section.getItems().forEach(function(curr, index){

    if(curr.template != 'default') return;

    var defer = Q.defer();

    TiImageCache.checkIfExists(curr.properties.link, defer).then(function(res){

      console.log(res, index);
      curr.logo.image = '/images/defaultImage.png';

      $.section.updateItemAt(index, curr);

    });

  });

}

but for some reason, this never works... already tried to set an locally image on that property but still not working.

PS: on iOS it works just fine, on Android it's not.

AvImageView version 0.1.5 - Can't update to 6+ yet
TiSDK 5.5.1.GA
Appc-CLI 5.5.1

Thanks

It doesn't render image even `loadingIndicator:false` in Android Listview item template.

This is a great module! Thanks!
It works on iOS perfectly, even in Listview item template.

But Android, it doesn't.
I followed your guide. I red a know issue related Android Listview.
(loadingIndicator : false)

But AvListview renders nothing on Android list view. (Just blank)

Is there another issue?

alloy.js

var AvImageview = require('av.imageview');
Alloy.Globals.AvImageview = require('av.imageview');

myController.js

". itemImg":{
  height: 121,
  width: 100,
  top: 0,
  backgroundColor: "transparent",
  left: 2,
  right: 2,
  contentMode : Alloy.Globals.AvImageview.CONTENT_MODE_ASPECT_FILL,
  loadingIndicator : false
}

myController.css

...
<Templates> 
    <ItemTemplate name="meetupItem" class="meetupItem">
        <View class="itemWrap">
            <ImageView ns="AvImageview" class="itemImg" bindId="img0"></ImageView>
        <View>
    </ItemTemplate>
</Templates> 
...

"AvImageview is not defined" trying to load into classic ListView Template in Android

Hi,
I have followed this classic example:
https://github.com/AndreaVitale/av.imageview/blob/master/ios/example/app.js#L29

But I'm receiving this error "AvImageview is not defined" when I try to load the library into a ListView Template in Android using Classic not Alloy.
In iOS this doesn't happen, it loads correctly. I have checked and it is installed correctly for both platforms Android & iOS.

I appreciate your help.

Example listView (without Alloy views)

Hi,

Can we get an example for a implementation in a listView if no views are defined in Alloy? We have the templates structure in the TSS file, so no views.

screen shot 2017-10-07 at 13 18 06

Change the loading indicator color

The loading indicator is not visible when the app background is black (iOS Only). How can I Change the color of the loading indicator.

Thanks,

Android: Image not resizing on size-change, performance issues with local images

Hey there,

we are running into a few Android issues that'd like to collect. Maybe someone experienced something similar and/or has a workaround:

  • If the size of an image changes, the image does not re-scale (works on iOS)
  • The performance seems to be really bad if multiple (local) images are used. This was noticed in both a ScrollView and ListView component where we needed to display images as part of their templates. This maaay be related to the size of the images, which we could sample down, but maybe something else is weird here. This works both on iOS and with classic ImageView instances

That's really it! If someone has a workaround for the first one (maybe re-setting the image and/or content-mode?), that'd already be lit!

Support for animated GIFS (Android)

This library uses Glide which handles gifs with the asGif method. The current request listener expects a <String, GlideDrawable> and will not support gifs. A new request listener should be formed depending on the mimetype of the image being pulled.

private String getMimeType(String url) {

        String type = null;

        String extension = MimeTypeMap.getFileExtensionFromUrl(url);

        if (extension != null) {

            type = MimeTypeMap.getSingleton().getMimeTypeFromExtension(extension);

        }

        return type;

    }

If it returns a gif, the RequestListener should create a request with <String, GifDrawable> and use the asGif method when loading into the imageview.

example:

import com.bumptech.glide.load.resource.gif.GifDrawable;

private RequestListener<String, GifDrawable> requestListener;

Can't update image attribute after views are loaded (Android)

I can't seem to update the image after the view is loaded.

When I set the image attribute when the the controller/view is created it works, but when you use a timeout or, in my case, use a remote image URL from a third party API (which I have to load with a XHR request), it won't load.

Example:

// update image
setTimeout(function() {
	$.resultImage.image = 'https://cdn.skoften.net/images/65311/pic_007_(1).gif';     
},1000);

This results in a empty view. No loading indicator, no defaultImage.

Platform: Android
SDK: 7.0.1.GA

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.