How to measure image download time in a webpage? - image

I need to measure the time taken to load an image from the server on my website. Let's say I have four images on a webpage; I want to display to the visitor the time it took for each image to load.
What are the ways to achieve this?

create a timer so when the user selects download button the timer starts and when the transfer is done stop it and display it.

Related

Loading images in the browser

I am developing a website with a main page where a lot of products are displayed each with his own image. I would like to ask is there a better way to implement image loading to improve user experience ? I am not talking about optimization but purley about user experience. What I mean is should I let the image load slowly and the user has to wait on a blank screen for it or should I replace the image with a loading animation until it loads. Sure I have a loading screen for loading new products but I am talking about the whole product card is there all the data is there it just waits for the image and on it's place is a loading animation, I think this way the user will know that there will be something there and will wait to see it. If I should do that what is the correct way to implement it? Do I use promises to wait for the image to load or some other way ?
Currently I am using this way to load images <img src="url"></img>.

How can I make it so a gif image replays once every time the page refreshes in Wordpress?

My gif image playsy one time when I open my Wordpress page and it will replay sometimes when I press refresh but usually it just plays upon loading, the first time. Is there some code I need to make it replay every time I refresh the page?

Website loads image with 1-2 second delay. Could I increase the performance somehow?

recently I made a website for my photography. htttp://www.simotamas.com
I am a newbie, so its not the best site but it works fine for me, I got only one problem, when a site is loaded on a device for the first time, the gallery loading time takes up to 1-2 seconds.
Could you guys please check if I mess up something with the code?
Or should I made the pictures even smaller?
Any way I could increase the loading performance.
I would be really thankful for any advice.
Some points you can consider
Use thumbnails for preview (low resolution) , while clicking load actual image.
Load images of only visible part first then load the images in bottom. (May affect user experience)
if you have cpu power , use any libraries like cache tools or compression tools like
https://nielse63.github.io/php-image-cache/ . benchmark it carefully.
use gzip if you are not using gzip compression for your server.
The fact your website doesn't wait for the image to load is considered a plus (look into asynchronous web page content loading for a good read) that said you should compress your images before uploading them.. tinypng.com is a nice tool for it... But if it's a photography website doing so would reduce picture quality... Try to play with Photoshop save settings to find your ideal compromise between quality and size with respect to "memory" size... Pictures are heavy.. high definition and resolution will obviously result in heavier files to download
Update: another thing you could do is actually display (smaller) thumbnail and only load the full picture on request. I.e: user clicks and image opens in new tab
It would help if you create smaller thumb versions of your images so the browser can initially load these ones for the overview and no need for scaling way to big images down while rendering the page. An image should always be downloaded in the dimension it's going to be presented.

working with images in windows phone app - performance

I have an app that allows users to take pictures and store them in the IsolatedStorage. These images are then retrieved to display them in a list. The app suffers from performance issues when there are more than 30+ images in the list. It is taking a long time to retrieve these images from the storage and bind them to the list. A lot of times, the app is just closed by OS because it takes too long.
Also, I think as better resolution devices are coming in the market, the images are getting created with bigger sizes and affecting performance even more.
I need some guidance on how to resolve this. Couple of things I have though about:
1) how can I asynchronously retrieve every image to be retrieved from IS so the page can load but the images are being retrieved in async fashion. Any sample code is appreciated.
2) the other approach will be where I create a thumbnail photo of the actual photo (smaller size and resolution) while storing the original photo and use this thumbnail photo in binding to the list later. If this should be done, then how should I go about processing the image on the fly to create a smaller size thumbnail version of the original photo.
Any other ideas are appreciated as well.
Thanks for your time.
If you are able to, I would recommend using the Async CTP and making the code that loads images from isolated storage async. The methods that generate the thumbnails can be async as well.
If you cannot do this (add these dependencies to your project), use a BackgroundWorker. Perhaps this article can help you get started.
This will allow your UI to be responsive while processing continues on threads in the background.
Do not pretend the Isolated Storage as a SQL Server. There will be great performance difference. If you want to process too much data, send them to server.
However, there is a method for getting a thumbnail. You can use it:
http://msdn.microsoft.com/en-us/library/system.drawing.image.getthumbnailimage.aspx
Also, please check this answer:
Create thumbnail image

WebSite Loading time

I'm developing a site which has a slider on home page.I'm using nivo slider.
The images in the slider are of sizes 1600*1200.Due to this the home page is taking too much time to load.
Is there a way so that the images sizes are reduced on the fly or I've to first compress each image and then upload it to the server.
Is there any other alternative method, please suggest one if any.
You can load the images asynchronously with help of jQuery. Here is the tutorial for loading images in nivoslider asynchronised. This will reduce the page load time tremendously.
You can load the 1st image before the others, which is enough to show the slider. Afterward, you can asynchronously load the other images.

Resources