Php photo gallery TWG | JFUploader | TWG Flash upload | WFU | Forum

Get help for TinyWebGallery, the best image gallery. The forum is also home for the Joomla JFUploader, TWG Flash Uploader and the Wordpress flash uploader.
It is currently 24. Nov 2024, 22:43

This forum is readonly now. Please use the new forum if you don't find the answer to your question here. The new forum is at https://www.tinywebgallery.com/blog/forum/


All times are UTC + 1 hour [ DST ]




Post new topic Reply to topic  [ 7 posts ] 
Author Message
PostPosted: 17. May 2006, 06:47 
I've used the code available on How-To 4 (How to setup a random image on a different site/frame) to make the thumbnails in this page:

Although it works fine, it takes too long (and too much processor cycles) to build all the thumbnails on the fly. Is there any way to cache these images?

Thanks


Top
  
 
 Post subject:
PostPosted: 17. May 2006, 09:44 
Offline
Site Admin
User avatar

Joined: 1. Aug 2005, 12:53
Posts: 11232
Hi,

I cannot connect to you server through our firewall :(.

But yes I have some code to reuse the thumbs if the random pic size = the thumbsize!

you have to open image.php and scroll to the very bottom. There are some comments

/*
$thumb = "./" . $cachedir . "/" . urlencode(str_replace("/", "_", $twg_album) . "_" . $image) . "." . $extension_thumb;
if (file_exists($thumb) && ($randomimagesize == $thumb_pic_size)) {
putimage($thumb);
} else {
*/

and

// }

further down - remove the /* */ and the //

Then the thumb is used if the sizes match. I commented this because you can make watermarks on the thumbs too - but I don't use this - therefore using this few lines is fine.
It does only work for "easy" filenames - I haven't encoded everything properly there! I'll do this for the next release.

/Michael


Top
 Profile  
 
 Post subject:
PostPosted: 17. May 2006, 09:51 
Offline
Site Admin
User avatar

Joined: 1. Aug 2005, 12:53
Posts: 11232
ok - I fixed that on my local build.

If you have uncomented the lines you have in this part 2 times $image

change this to

urldecode($image)

then it wis working for all filenames

/Michael


Top
 Profile  
 
 Post subject:
PostPosted: 17. May 2006, 19:18 
Offline

Joined: 16. May 2006, 17:15
Posts: 53
Location: Rio Claro - SP - Brazil
Hi,

That would not work for me because the random images and the thumbs are different in sizes.

I'd like to cache the random images themselves.

Maybe this URL works under firewall (thought the images are in the other saves and may not load due to the firewall restrictions):


Top
 Profile  
 
 Post subject:
PostPosted: 18. May 2006, 01:49 
Offline
Site Admin
User avatar

Joined: 1. Aug 2005, 12:53
Posts: 11232
Then you have to change the generateRandom function of inc/imagefunctions.inc.php

Right now the images are not saved - you wouild just have to save them and if they are already present use them.

I have used this a couple of times in TWG already - If shouldn't be a big deal to do this for random images too.

/Michael


Top
 Profile  
 
 Post subject:
PostPosted: 23. May 2006, 09:05 
Offline
Site Admin
User avatar

Joined: 1. Aug 2005, 12:53
Posts: 11232
Hi I added this to the latest build of TWG (uploaded 23.5. - still 1.4.2).

see $enable_random_image_caching in the config.php ;).
it's disabled by default.

/Michael


Top
 Profile  
 
 Post subject:
PostPosted: 23. May 2006, 09:20 
Offline

Joined: 16. May 2006, 17:15
Posts: 53
Location: Rio Claro - SP - Brazil
Hi Michael,

Thanks a lot :)


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 7 posts ] 

All times are UTC + 1 hour [ DST ]


Who is online

Users browsing this forum: FAST WebCrawler [Crawler] and 70 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
cron
powered by phpbb | Datenschutz/ Privacy policy