Php photo gallery TWG | JFUploader | TWG Flash upload | WFU | Forum
https://www.tinywebgallery.com/forum/

Auto-creating thumbnails on upload
https://www.tinywebgallery.com/forum/viewtopic.php?f=12&t=1033
Page 1 of 1

Author:  adrianaitken [ 10. May 2007, 23:39 ]
Post subject:  Auto-creating thumbnails on upload

hi Micheal, whilst you're here.... :D
I copied the send_thumb commands from the file.php and added it to the upload.php file. The bit I'm stuck on is what is the filename format the send_thumb routine wants. I've tried full path, just filename etc and nothing wants to work. :cry: I put the command just after the removeCachethumb command (about line 62) - is the right place ?

Many thanks
Adrian

Author:  TinyWebGallery [ 11. May 2007, 09:39 ]
Post subject: 

I think you want to create a thumbnail right after upload?

this does not work your way ;) - send_thumb only sends it - it does not write a thumb the way you like (only in my thumb dir in an encoded way). if you want a thumb with your name:

you have to use resize_file - the last parameter is the destination

$thumb = "thumbs/" . basename($dir) . "_" . $file['name'];
resize_file( $filename, 200, 80, $file['name'], $thumb);
if (!file_exists($thumb)) {
copy ($filename, $thumb);
}

you have to copy because resize does only resize images that are too big ;).
the last parameter only exists in the latest version of the tfu_helper.php

/michael

Author:  adrianaitken [ 11. May 2007, 11:12 ]
Post subject: 

hi Micheal, I am trying to do thumbnails your way !!! I want to pre-populate the previews (both small and large) so when others click on them they are available instantly. I think (certainly for my webserver), getting a processor hit once (when they've been uploaded) is better than getting random hits when people look at the images. Now I know the uploader isn't really supposed to be a viewer but I just need a quick and dirty viewer :lol:

Regards
Adrian

Author:  TinyWebGallery [ 11. May 2007, 11:47 ]
Post subject: 

then you should try to understand what the send_thumb is doing ;).

should not be that hard ;). you should maybe add another flag to the send_thumb method to disable the real sending when you call it.

/Michael

Page 1 of 1 All times are UTC + 1 hour [ DST ]
Powered by phpBB® Forum Software © phpBB Group
http://www.phpbb.com/