Sackgesicht VIP
Total posts: 1,636
15 Июль 2017 04:56

Is there an API call for thumbnails? Something which will check of the thumbnail is already generated and if not generate it, maybe return the URL of the generated thumbnail...

Последние изменения: 21 Сен 2023


Sergey
Total posts: 13,748
26 Июль 2017 03:54

Yes. There is. Look at components/com_cobalt/fields/image/tmpl/output/list.php

$url = CImgHelper::getThumb(
    JPATH_ROOT . DIRECTORY_SEPARATOR . $image->get('image'), // Path to original image
    $this->params->get('params.thumbs_list_width', 100), // Max width in px
    $this->params->get('params.thumbs_list_height', 100), // Max height in px
    'image', // Subfolder for cobalt_thumbs folder
    $record->user_id, // ID of the use owns imade. optional. Use 0
    // Options how to generate thumbnail
    array(
        'mode' => $this->params->get('params.thumbs_list_mode', 1), // Mode how to generate. You can snick pick modes in parameters of the field 
        'strache' => $this->params->get('params.thumbs_list_stretch', 0), // Stratch image into new dimentions
        'background' => $this->params->get('params.thumbs_list_bg', "#000000"), // Background color
        'quality' => $this->params->get('params.thumbs_list_quality', 80))); // Quality in % 0-100

siya
Total posts: 8
21 Сен 2023 14:54

Just join it for searching file explorer windows 10 its useful to users.

Работает на Cobalt