Sackgesicht VIP
Total posts: 1,636
29 Янв 2013 01:52

When uploading pictures through the gallery field, they will be automatically compressed, which results in a poorer quality.

The field parameter do not show any parameter to adjust this.

I observed, that the thumbnail creation also differs. When uploading the first time a different thumbnail is generated than later when you either save an additional picture or the thumbnails are generated again,

Maybe the first thumbnail was generated by the original uploaded file, before it was compressed and the later thumbnail comes from the compressed (less quality) version.

How can we access or generate thumbnails based on our own settings ( a customized template) ?

Example, i want to display small thumbs (40 px high) of the gallery images as a link to the default display mode (gallery or lightbox).

Последние изменения: 02 Март 2014


Sergey
Total posts: 13,748
01 Фев 2013 01:01

The field parameter do not show any parameter to adjust this.

Do you mean quality parameter? I have changed that original process was always with quality 100.

The field parameter do not show any parameter to adjust this.

Maybe the first thumbnail was generated by the original uploaded file, before it was compressed and the later thumbnail comes from the compressed (less quality) version.

This is the feature of Cobalt we do not generate thumbs on upload. Only on display. This give us flexibility and ability to change thumb size at any time without resaving all records.


Sackgesicht VIP
Total posts: 1,636
01 Фев 2013 02:59

I will check again , but i observed that the thumbnail creation after deleting thumbnails have a worse quality .. Will report later more in detail


Sackgesicht VIP
Total posts: 1,636
01 Фев 2013 06:31

Example, i want to display small thumbs (40 px high) of the gallery images as a link to the default display mode (gallery or lightbox).

How do i create /display thumbnails with a different dimension in my own templates?


Sergey
Total posts: 13,748
02 Фев 2013 10:46

You can set dimensions in field parameters right? Did you look into gallery output template? Give me real example of what you want may be I can give you piece of code.


Sackgesicht VIP
Total posts: 1,636
03 Фев 2013 04:01

I will add an image icon beside the title to indicate that there are images in the gallery field.

Then i will use a popover to show the thumbnails..


<?php if(isset($item->fields_by_id[24]->result) && $params->get('tmpl_core.a_gallery')):?> <img href="#" id="gallery" rel="clickoverrel" data-content="<?php echo count($item->fields_by_id[24]->value)." Image(s)";?>" data-placement="top" data-original-title="Images" src="/<?php echo JURI::root()?>media/mint/icons/16/images-stack.png"> <?php endif;?>

Now it would be nice to display the small thumbnails (maybe 40 or 60 px) in the popover.


Sergey
Total posts: 13,748
04 Фев 2013 00:41

$item->fields_by_id[24]->result contain result of field template. I think you need

data-content="fields_by_id[24]->result);?>"

Then it will show result of the field in clickover. And you can manage it by field parameters or even creating new field template.


Sergey
Total posts: 13,748
04 Фев 2013 00:42

""" = "&quot;"


Sackgesicht VIP
Total posts: 1,636
04 Фев 2013 01:36

No, i need an additional thumbnail resize. I use the thumbnail from the parameter for something else.. just a different size which i will hard code into the template .. lets say 60 x 60 ..

Lets try it with other words:

How can i display a thumbnail with different dimensions than in the template parameter?

An example would be the "Gallerybox mode" for article view. It generates small thumbnails other than the size defined in the parameters. I will try to see the source code for this ..

See here :


Sergey
Total posts: 13,748
04 Фев 2013 06:50

Somehow I understand but why cannot you use Parameters? Why you need to set custom size? Since you will not show it anywhere else you can use parameters I think.

Anyway there is special helper

user_id, array( 'mode' => $this->params->get('params.thumbs_mode', 1), 'strache' => $this->params->get('params.thumbs_stretch', 0), 'background' => $this->params->get('params.thumbs_bg', "#000000"), 'quality' => $this->params->get('params.thumbs_quality', 80))); ?>

This will return URL or generated thumbnail.

See image field templates for example.

Работает на Cobalt