Results 1 to 5 of 5

Thread: thumbnails ?

  1. #1
    New user
    Join Date
    03-03-10.
    Posts
    2

    Default thumbnails ?

    Hi all,

    i was planning use typolight for a projet but i have a problem, i needs develop a module with texte and image et i needs thumbsnail for each image but the probleme is : there is nothing in the file explorator for creat thumbnails with the dimension you needs... and in different size on different folder (i will have different module with different thumbnails size)...

    Then because of that i don't know anymore if i can use TL for this project.. is there any solution for have thumbnail in the size you want for the image you upload in the file explorator ? and of course this thumbnails erase if you erase an image....

    Thanks in advance for your help !

  2. #2
    Experienced user
    Join Date
    06-10-09.
    Location
    Cape Town, South Africa
    Posts
    1,387

    Default Re: thumbnails ?

    all thumbnails in TL are auto-sized and cached on the fly. Each module or content element that references image, have an option to resize the image from its original size to your new size. These files are then created and stored as cache files, which are linked to the page. Most of the time you can then specify that the thumbnail be opened in a lightbox to enlarge the thumbnail.

    If you were talking about the File Explorer which cannot pre-size the images before upload. This is not part of the HTML specification. Only (1) a FLASH file can pre-size the file to upload and (2) a JAVA-native application (not javascript) can also do this. This is why FaceBook's Image Uploader is a JAVA-native application (they changed from Flash).

  3. #3
    New user
    Join Date
    03-03-10.
    Posts
    2

    Default Re: thumbnails ?

    Im sorry im not sure you understand what i mean but my english is not very good too ops: , i'll try explain, i needs develop different module on the projet, let say 3 modules, this 3 modules will have image and this images will be show in frent end as thumbsnail.

    Of course i don't want use the full size image resize in thumbnail in the front because of the weight, then for that i needs create thumb in backoffiche when i create a new entry.

    But in TL you upload your picture in the explorateur of files, and after that you link the picture in your item, then i don't understand how create the thumbnail in my module, because where will be stock the thumb file ? this file will be erase if i erase the item in the backoffice ? or i must use callback for erase this thumb ?

    Im sorry if it's not very clear, im french and it's hard explain in english :?

  4. #4
    Experienced user
    Join Date
    06-10-09.
    Location
    Cape Town, South Africa
    Posts
    1,387

    Default Re: thumbnails ?

    Like I said, thumbnails are autocreated in TL... using the method in Controller.php:

    Code:
    protected function addImageToTemplate($objTemplate, $arrItem, $intMaxWidth=false, $strLightboxId=false)
    You provide the size, single/multiple (for galleries), floating, imagurl, fullsize, caption, imagemargin, alt, etc. in an array and this method will use the $this-> getImage(filename, width, height, mode) to create the image.

    It will generate a thumbnail in the in system/html/ folder, so that its possible to link a file into the IMG tag. If you remove the image, the thumbnail isn't removed, so the file will remain, unless you also clear the cache manually. If in your module you remove the file, you can also optionally remove the cache file yourself, as the cache file will be a unique MD5 name constructed from the image parameters:

    Code:
    $strCacheName = 'system/html/' . $objFile->filename . '-' . substr(md5('-w' . $width . '-h' . $height . '-' . $image . '-' . $mode), 0, 8) . '.' . $objFile->extension;
    So when the NewsList Module wants to display its news Items, it looks to see if you've changed the size of the original image you link to the news item. If you changed the size, it creates a new cache thumbnail (in system/html/) -- something like this:

    Code:
    campus_building-9306569d.jpg
    This image is then the thumbnail version and your source code will link to that instead of the original file in tl_files/, e.g.
    Code:
    [img]system/html/campus_building-9306569d.jpg[/img]

  5. #5
    New user
    Join Date
    03-09-10.
    Posts
    2

    Default Re: thumbnails ?

    Thumbnails are the most important features that enhances the overall look. It is very important to strike the right chord to have it working the right way. I do add thumbnails to my sites but the way described over here would make it look more interesting.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •