This returnCurrentImages
is a fotorama API object function. These fotorama object data's are set from gallery element. As you can see the gallery element in the below path:
vendor/magento/module-catalog/view/frontend/templates/product/view/gallery.phtml
In this gallery.phtml file you can see the below script
<script type="text/x-magento-init">
{
"[data-gallery-role=gallery-placeholder]": {
"mage/gallery/gallery": {
"mixins":["magnifier/magnify"],
"magnifierOpts": <?= /* @noEscape */ $block->getMagnifier() ?>,
"data": <?= /* @noEscape */ $block->getGalleryImagesJson() ?>,
"options": <?= /* @noEscape */ $block->getGalleryOptions()->getOptionsJson() ?>,
"fullscreen": <?= /* @noEscape */ $block->getGalleryOptions()->getFSOptionsJson() ?>,
"breakpoints": <?= /* @noEscape */ $block->getBreakpoints() ?>
}
}
}
The gallery element data's are set from this script only.
The this.fotorama.data
data was updated in below mentioned line in that script:
"data": <?= /* @noEscape */ $block->getGalleryImagesJson() ?>,
The actual image Json data's are got from getGalleryImagesJson()
function, as you can see this function definition in below path:
vendor/magento/module-catalog/Block/Product/View/Gallery.php