Source
1003 * if it is 0 return the height, if it is 1 return the width.
1004 * @return string|int|null
1005 */
1006 public function getDimensions($dim = "string") {
1007 if($this->getField('Filename')) {
1008
1009 $imagefile = $this->getFullPath();
1010 if($this->exists()) {
1011 $size = getimagesize($imagefile);
1012 return ($dim === "string") ? "$size[0]x$size[1]" : $size[$dim];
1013 } else {
1014 return ($dim === "string") ? "file '$imagefile' not found" : null;
1015 }
1016 }
1017 }
1018
Trace
- Image->getDimensions(0)
Image.php:1024
- Image->getWidth()
Image.php:707
- Image->isWidth(80)
Image.php:379
- Image->ScaleWidth(80)
Image.php:528
- Image->SetWidth(80)
ViewableData.php:466
- ViewableData->obj(SetWidth,Array,,1)
ViewableData.php:539
- ViewableData->XML_val(SetWidth,Array,1)
SSViewer.php:187
- SSViewer_Scope->__call(XML_val,Array)
SSViewer.php:650
- SSViewer_DataPresenter->__call(XML_val,Array)
.cache.themes.oset2015.templates.Includes.docfiles.ss:36
- include(/home/osetbike/public_html/silverstripe-cache/osetbike-php7.4.33/.cache.themes.oset2015.templates.Includes.docfiles.ss)
SSViewer.php:1172
- SSViewer->includeGeneratedTemplate(/home/osetbike/public_html/silverstripe-cache/osetbike-php7.4.33/.cache.themes.oset2015.templates.Includes.docfiles.ss,NewsItem_Controller,Array,Array,SSViewer_DataPresenter)
SSViewer.php:1234
- SSViewer->process(NewsItem_Controller,Array,SSViewer_DataPresenter)
SSViewer.php:1273
- SSViewer::execute_template(docfiles,NewsItem_Controller,Array,SSViewer_DataPresenter)
.cache.themes.oset2015.templates.Layout.NewsItem.ss:83
- include(/home/osetbike/public_html/silverstripe-cache/osetbike-php7.4.33/.cache.themes.oset2015.templates.Layout.NewsItem.ss)
SSViewer.php:1172
- SSViewer->includeGeneratedTemplate(/home/osetbike/public_html/silverstripe-cache/osetbike-php7.4.33/.cache.themes.oset2015.templates.Layout.NewsItem.ss,NewsItem_Controller,,Array,)
SSViewer.php:1234
- SSViewer->process(NewsItem_Controller,)
SSViewer.php:1230
- SSViewer->process(NewsItem_Controller)
Controller.php:201
- Controller->handleAction(SS_HTTPRequest,index)
RequestHandler.php:208
- RequestHandler->handleRequest(SS_HTTPRequest,DataModel)
Controller.php:151
- Controller->handleRequest(SS_HTTPRequest,DataModel)
ContentController.php:174
- ContentController->handleRequest(SS_HTTPRequest,DataModel)
ContentController.php:154
- ContentController->handleRequest(SS_HTTPRequest,DataModel)
ContentController.php:154
- ContentController->handleRequest(SS_HTTPRequest,DataModel)
ModelAsController.php:75
- ModelAsController->handleRequest(SS_HTTPRequest,DataModel)
PrefixModelAsController.php:69
- PrefixModelAsController->handleRequest(SS_HTTPRequest,DataModel)
Director.php:383
- Director::handleRequest(SS_HTTPRequest,Session,DataModel)
Director.php:147
- Director::direct(/gb/news-and-reports/news/from-small-acorns,DataModel)
main.php:206