On Saturday 11 August 2007 03:37:28 raoul wrote:
> I'm facing a problem with evas and image objects. Here it is:
> I have a jpeg file 01.jpg and if I load it with
> evas_object_image_file_set() it works. But if the file changes (ie.
> replaced by another),
> evas_object_image_file_set() on that file again does not load the new but
> keep the old image.
> I've tried to call evas_object_image_reload() but it does not work. Is
> there something I need to do to force evas to reload an image? Or there is
> a problem with the evas caching system?
It's currently a FIXME in evas_cache_image.c :
if (stat(file, &st) < 0) return NULL;
/* FIXME: Handle timestamp correctly. */
im = evas_hash_find(cache->activ, hkey);
if (im)
goto on_ok;
im = evas_hash_find(cache->inactiv, hkey);
if (im)
{
cache->lru = evas_object_list_remove(cache->lru, im);
cache->inactiv = evas_hash_del(cache->inactiv, im->cache_key, im);
cache->activ = evas_hash_direct_add(cache->activ, im->cache_key, im);
cache->usage -= cache->func.mem_size_get(im);
goto on_ok;
}
I am sorry I don't have enougth time to fix and test a patch to this problem.
But basically, we need to test im->timestamp against st.st_mtime, if the
image is older, we must mark it as must be dropped as soon as possible (Or we
can mark it as dirty and add a check in evas_cache_image_drop on
im->references). Of course if the image didn't change we can just return it
after updating im->laststat.
I hope I can come back soon on this code. Many improvement could be
done.
Cedric
-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems? Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
enlightenment-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/enlightenment-devel