A bit more work than I expected to update the cache so that it works in the same way as normal cache. Especially, as I hadn't committed Wout's patch until too late, meaning that I had to apply the patch by hand.Let's hope that I didn't break anything else in the process. Quite a few files changed to this and a few function names too.
Actually a few things broke ;). I won't blame you since I know how it is to apply patches to the same file on the same revision from various people. You did a nice job in putting things back again. However I saw the following issues and fixed them 1. If you delete a cached image and then use webserver and click on the image, you will see that the image is scaled to 200x200 (with aspect) in the pop-up window. This happens because the return value of fileops.create_www_thumbnail() is the size of the thumbnail image. I fixed it to return the size of the original image. 2. The fileops.get_www_thumbnail_size() returns the size of the image and not the size of the thumbnail. Anyway we don't use that method anywhere, so I deleted that. 3. Images files in cache have double extensions, like my_image.png.png and in some extreme cases like for gif files there are 3 extensions, like my_image.gif.gif.jpg. So I made some changes so that the cached image filename will be exactly the same as the original image except for the case of gif files.
Would you be so kind as to test it, my tests look good.
I am kind so I did the testing :)
One thing that is puzzling me is why is it slow, any idea.
What is slow? I lost the context here. Do you mean the "freevo cache" or the webpage loading or something else?
The same fix that you did to bring the window to focus for the images could be applied to the remote on the index page.
I did this fix also. Now it is your turn to test :P Chandan
BTW great job with the images. Duncan ------------------------------------------------------------------------- Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys - and earn cash http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV _______________________________________________ Freevo-devel mailing list Freevo-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/freevo-devel
Index: src/www/htdocs/library.rpy =================================================================== --- src/www/htdocs/library.rpy (revision 8961) +++ src/www/htdocs/library.rpy (working copy) @@ -483,7 +483,7 @@ if not os.path.exists(scaled_image_path): size = util.create_www_thumbnail(item) else: - size = util.get_www_thumbnail_size(item) + size = imlib2.open(item).size image_link = self.convert_dir(filepath) scaled_image_link = self.convert_dir(scaled_image_path) fv.tableCell('<div class="image"><a href="javascript:openfoto(\''+image_link+'\','+str(size[0])+','+str(size[1])+')">'\ Index: src/www/web_types.py =================================================================== --- src/www/web_types.py (revision 8961) +++ src/www/web_types.py (working copy) @@ -563,6 +563,7 @@ } var params="toolbar=no,location=no,status=no,menubar=no,resizable=no,scrollbars=no,top=0,left=0"; remoteWin = window.open("webremote.rpy","WebRemote",params); + remoteWin.focus(); } --> </script> Index: src/util/fileops.py =================================================================== --- src/util/fileops.py (revision 8961) +++ src/util/fileops.py (working copy) @@ -569,7 +569,7 @@ file_ext += ".jpg" # the filename extension needs to be lowercase for imlib2 but we need to # keep the original filename for cache to be able to clean the files - imagepath = filename + file_ext + imagepath = filename[:file_ext_index] + file_ext thumb_path = vfs.getwwwoverlay(imagepath) return thumb_path @@ -591,12 +591,4 @@ except IOError, e: print e return (0, 0) - return thumb.size - - -def get_www_thumbnail_size(filename): - '''returns the size from a webserver cached image. - ''' - thumb_path = www_thumbnail_path(filename) - image = imlib2.open(filename) return image.size
------------------------------------------------------------------------- Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys - and earn cash http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________ Freevo-devel mailing list Freevo-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/freevo-devel