Show gif while image is loading (wicket) - wicket

I am following this guide for displaying images in wicket How to load external Images
I see one problem and dont know how to solve it. Consider this piece of code
StaticImage img=new StaticImage( "icon", new Model(loadingGIFURL));
//get real image url
img.setDefaultModel(new Model(realURL))
It doesnt show the loading gif, because I override the DefaultModel. So how can I still show my loading gif but "preload" the real image and when the real image is downloaded then replace the loading gif with my image.
Note that I dont have a image source like base64, I only have the image url

Related

How to load all gallary images quickly in flutter

I want to make a custom image picker in a custom bottom sheet. I did it using photo_manager package and it works, but it loads images with full resolution, so it is so slow and it gets slower as I scroll down to see more images.
how can I load gallary images into a bottom sheet so fast? (as fast as telegram chat image picker!)
There is a option for thumbnail:
Uint8List thumbDataWithSize = await entity.thumbDataWithSize(width,height); //Just like thumbnails, you can specify your own size. unit is px; format is optional support jpg and png.
I've used it with 400*400, and it's quite ok

UIWebView loading partial images

In my UIWebView I am loading html page from document directory. The html page contain most of the images. But when I tried to load that page, it displays partial images, some images are cropped & it shows grey area. I have tried to cache the images but still I am facing the same issue. The dimension of the images are near about 512x673 & size is 100KB with 70dpi.
I can't find the exact issue.
Please reply if anyone have idea.
Thanks in advance.

Magento product resize image issue

my server getting too slow due magento's resize image. i am using following code for display image
echo $this->helper('catalog/image')->init($_product, 'small_image')->resize(250,250)
This is load actual image (if i upload havy image like 2mb,3mb ) if i am not using resize function but if i use this function then its always resize it to 250x250 that makes server extra work of resizing image which can be done once at uploading image
i just want to avoid this resize process so every time image will not resize it should be resized when we uploading in magento when create a product. please give me solution
just skip the resizing. Everything is done in __toString() so if you remove the resize() there is no resizing and the file is only copied to the cache.
EDIT
It is important that you have the right small image uploaded in the backend. You can upload multiple images. And set three (in standard installation image, small_image and thumbnail) in the backend. These images can be access via
$this->helper('catalog/image')->init($_product, 'IMAGE_TYPE')
So if you upload a 250x250px image, mark it as thumbnail then you can remove the resize and everything works fine.
What you can do - but don't ask me how - is to put the resized images into the cache. But there are a lot of problems, after inserting them, e.g. flush the image cache -> all images are deleted

iPhone : Problem while displaying captured image in UIWebView

I am displaying graph by capturing image and loading into a webView using loadHTMLString method.
The images come fine when displayed the first time. But it does not seem to change when I recapture the image which is different.
Also I have checked that the image name is same and the new image is recaptured every time.
It seems to be some issue with UIWebView reloading.
what could be wrong ?
If the same image with the same name is being captured, it may be cached in the UIWebView, causing it to display as the initial image instead of the updated images. If there's a way to use the reload function of the webview (which, in a browser will often check for updates to images), this might help.
If that doesn't solve it, I'd make sure that you're not somehow saving and appending the captured HTML to a variable, causing the new text to be appended to the end of the variable and not loaded.

question regarding <img> and thumbnails

I have a photo site which renders previews of my photos in a tag when i hover some dots. (see http://johanberntsson.se/photo/).
But it feels kinda stupid to load the full image in to an img-tag. Because as far as i know, theres no difference between loading the image with its original size versus adding height and width attributes to it.
Got any suggestions how to improove my preview function?
Thanks
As far as client side is concerned, there's nothing you can do. If you're worried about how long it takes the image to load, you could always pre-load them with javascript. The only other thing would be to create a few sizes of your image on the server.
You should resize the image to get better speed. Here's an example in php
//Blob if image in database
$blob = mysql_fetch_...();
//else blob point to filename
$blob = "filename.jpg";
$gd = imagecreatefromstring($blob);
$resized = imagecreatetruecolor(X, Y); // new image dimensions
imagecopyresampled(....);
imagejpeg($resized);
Loading all the thumbnails in a giant sprite image used as a background image. Then position the background a the right place to have the right image a the right place.
This will improve the loading speed by loading only 1 image and allow the browser to cache the request of the image so, next time the user come to your site, it will load pretty fast.