image-loading

webpack require relative image

倾然丶 夕夏残阳落幕 提交于 2019-11-27 14:32:48
问题 I have two files: ./img/mypic.png ./js/help/targets/target.js In target.js: <img src={require("../../../img/target.png")} /> With webpack.config.js: 14 module: { 15 loaders: [ 16 { test: /\.js$/, loader: 'jsx-loader?harmony' }, 17 { test: /\.css$/, loader: 'style-loader!css-loader' }, 18 { test: /\.(png|jpg|jpeg|gif|woff)$/, loader: 'url-loader?limit=8192' }, Which compiles the image into ./[hash].png . Now, I use react-router , so I'm at /help/targets/target and webpack is giving the image

Universal-Image-Loader | SSLHandshakeException: Handshake failed

末鹿安然 提交于 2019-11-27 14:14:43
I have a ListView with some content (TextViews, ImageView...) in the items. I'm using UIL by Nostra to load the images in the items but some of them fail to load. This is what do I get, when i call Log.v(String.valueOf(failReason.getCause()); : 11-16 23:52:20.447: V/javax.net.ssl.SSLHandshakeException: Handshake failed(17467): failz 11-16 23:52:20.657: V/NativeCrypto(17467): SSL handshake aborted: ssl=0x15fd758: Failure in SSL library, usually a protocol error 11-16 23:52:20.657: V/NativeCrypto(17467): error:14077410:SSL routines:SSL23_GET_SERVER_HELLO:sslv3 alert handshake failure (external

Load image to a tableView from URL iphone sdk

不问归期 提交于 2019-11-27 11:51:33
I have tableView and need to load image from URL. I have an array that contains the URLs of images and when the page loads I need to load all the images into the tableview. Note that, not from a single URL, have an array with different URLs. How can I implement that? Please help Thanks. You can use GCD to load images in background thread, like this: //get a dispatch queue dispatch_queue_t concurrentQueue = dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0); //this will start the image loading in bg dispatch_async(concurrentQueue, ^{ NSData *image = [[NSData alloc]

Android Volley ImageLoader - BitmapLruCache parameter?

℡╲_俬逩灬. 提交于 2019-11-27 06:37:45
I am having trouble implementing Image cache using the new Volley library. In the presentation, code look like this mRequestQueue = Volley.newRequestQueue(context); mImageLoader = new ImageLoader(mRequestQueue, new BitmapLruCache()); The BitmapLruCache is obviously not included in the toolkit. Any idea how to implement it or point me to some resources? http://www.youtube.com/watch?v=yhv8l9F44qo @14:38 Thanks! Vladimir Mironov import android.graphics.Bitmap; import android.support.v4.util.LruCache; public class BitmapLruCache extends LruCache<String, Bitmap> implements ImageCache { public

How to load image from SD card using Picasso library

被刻印的时光 ゝ 提交于 2019-11-27 03:48:54
问题 i need to load images from the Sd card into gridview. For efficiency i'm using Picasso Library Picasso.with(activity).load(images.get(position).getDataPath()) .resize(96, 96).centerCrop().into(viewHolder.image); I used the following code in the adapter. unfortunately m unable to see any images so please can any one help. Note And also can anyone suggest any efficient image loading library to load the images from the sd card. Requirement I dont to load the image every time when scrolling. If

Detect when an image fails to load in Javascript

心已入冬 提交于 2019-11-26 18:52:32
Is there a way to determine if a image path leads to an actual image, Ie, detect when an image fails to load in Javascript. For a web app, I am parsing a xml file and dynamically creating HTML images from a list of image paths. Some image paths may no longer exist on the server so I want to fail gracefully by detecting which images fail to load and deleting that HTML img element. Note JQuery solutions wont be able to be used(the boss doesn't want to use JQuery, yes I know dont get me started). I know of a way in JQuery to detect when an image is loaded, but not whether it failed. My code to

Universal-Image-Loader | SSLHandshakeException: Handshake failed

半世苍凉 提交于 2019-11-26 16:38:48
问题 I have a ListView with some content (TextViews, ImageView...) in the items. I'm using UIL by Nostra to load the images in the items but some of them fail to load. This is what do I get, when i call Log.v(String.valueOf(failReason.getCause()); : 11-16 23:52:20.447: V/javax.net.ssl.SSLHandshakeException: Handshake failed(17467): failz 11-16 23:52:20.657: V/NativeCrypto(17467): SSL handshake aborted: ssl=0x15fd758: Failure in SSL library, usually a protocol error 11-16 23:52:20.657: V

image.onload event and browser cache

喜欢而已 提交于 2019-11-26 11:21:43
I want to create an alert box after an image is loaded, but if the image is saved in the browser cache, the .onload event will not be fired. How do I trigger an alert when an image has been loaded regardless of whether the image has been cached or not? var img = new Image(); img.src = "img.jpg"; img.onload = function () { alert("image is loaded"); } Fabrício Matté As you're generating the image dynamically, set the onload property before the src . var img = new Image(); img.onload = function () { alert("image is loaded"); } img.src = "img.jpg"; Fiddle - tested on latest Firefox and Chrome

Detect when an image fails to load in Javascript

蓝咒 提交于 2019-11-26 06:37:35
问题 Is there a way to determine if a image path leads to an actual image, Ie, detect when an image fails to load in Javascript. For a web app, I am parsing a xml file and dynamically creating HTML images from a list of image paths. Some image paths may no longer exist on the server so I want to fail gracefully by detecting which images fail to load and deleting that HTML img element. Note JQuery solutions wont be able to be used(the boss doesn\'t want to use JQuery, yes I know dont get me started

image.onload event and browser cache

别来无恙 提交于 2019-11-26 02:09:43
问题 I want to create an alert box after an image is loaded, but if the image is saved in the browser cache, the .onload event will not be fired. How do I trigger an alert when an image has been loaded regardless of whether the image has been cached or not? var img = new Image(); img.src = \"img.jpg\"; img.onload = function () { alert(\"image is loaded\"); } 回答1: As you're generating the image dynamically, set the onload property before the src . var img = new Image(); img.onload = function () {