A
A
Alexey Klyonin2018-10-24 14:17:35
1C-Bitrix
Alexey Klyonin, 2018-10-24 14:17:35

Bitrix + Fotorama = I can not make friends with the image resizer. What's wrong?

Good afternoon.
Faced the following problem.
There is a task to display several images in the detailed news. For this case, we use fotorama.
Since there are several images, in order for the page to load faster, we make thumbnails for the images. Thumbnails are made using the Bitrix function ResizeImageGet.
Everything almost works great, but sometimes on some pages, on first load, instead of the first large picture, it is displayed in full screen, small. Resized (oh shield, sorry for such slang) to the sizes that we asked earlier. Although, logically, a large and further thumbnail should be displayed.
What am I doing wrong?
Here is the code for the whole thing

<div class="col-12 p-0 fotorama"
         data-nav="thumbs" data-thumbwidth="250" data-thumbheight="141" data-allowfullscreen="true">
      <? 
      // additional photos 
      if(count($arResult["MORE_PHOTO"])>0):?> 
      <?foreach($arResult["MORE_PHOTO"] as $PHOTO):?>
      <? $file = CFile::ResizeImageGet($PHOTO, array('width'=>'250', 'height'=>'141'), BX_RESIZE_IMAGE_EXACT, true); ?>
      <a href="<?=$PHOTO["SRC"]?>"> 
      <img border="0" src="<?=$file["src"]?>"	alt="<?=$arResult["NAME"]?>" title="<?=$arResult["NAME"]?>" /> 
      </a> 
      <?endforeach?> 
      <?endif?>
    </div>

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question