"A non-numeric value encountered"
/var/www/vhosts/tcs.benehosting.be/httpdocs/etc/plugins/imager/services/ImagerService.php(1025)
1013 * @param $transform
1014 * @return \Imagine\Image\Point
1015 /
1016 private function _getCropPoint($resizeSize, $cropSize, $transform)
1017 {
1018 // get default crop position from the settings
1019 $position = $this->getSetting('position', $transform);
1020
1021 // get the offsets, left and top, now as an int, representing the % offset
1022 list($leftOffset, $topOffset) = explode(' ', $position);
1023
1024 // get position that crop should center around
1025 $leftPos = floor($resizeSize->getWidth() * ($leftOffset / 100)) - floor($cropSize->getWidth()/2);
1026 $topPos = floor($resizeSize->getHeight() * ($topOffset / 100)) - floor($cropSize->getHeight()/2);
1027
1028 // make sure the point is within the boundaries and return the point
1029 return new \Imagine\Image\Point(
1030 min(max($leftPos, 0), ($resizeSize->getWidth() - $cropSize->getWidth())),
1031 min(max($topPos, 0), ($resizeSize->getHeight() - $cropSize->getHeight()))
1032 );
1033 }
1034
1035
1036 /*
1037 * Returns the filter method for resize operations
Stack Trace
#0
– /var/www/vhosts/tcs.benehosting.be/httpdocs/etc/app/etc/web/WebApp.php(693): CApplication->handleError(2, "A non-numeric value encountered", "/var/www/vhosts/tcs.benehosting.be/httpdocs/etc/plugins/imager/s...", 1025)
688 if (version_compare(PHP_VERSION, '7.1', '>=') && strpos($message, 'Narrowing occurred during type inference. Please file a bug report') !== false)
689 {
690 return;
691 }
692
693 parent::handleError($code, $message, $file, $line);
694 }
695
696 // Private Methods
697 // =========================================================================
698
#1
– /var/www/vhosts/tcs.benehosting.be/httpdocs/etc/plugins/imager/services/ImagerService.php(1025): Craft\WebApp->handleError(2, "A non-numeric value encountered", "/var/www/vhosts/tcs.benehosting.be/httpdocs/etc/plugins/imager/s...", 1025, ...)
1020
1021 // get the offsets, left and top, now as an int, representing the % offset
1022 list($leftOffset, $topOffset) = explode(' ', $position);
1023
1024 // get position that crop should center around
1025 $leftPos = floor($resizeSize->getWidth() * ($leftOffset / 100)) - floor($cropSize->getWidth()/2);
1026 $topPos = floor($resizeSize->getHeight() * ($topOffset / 100)) - floor($cropSize->getHeight()/2);
1027
1028 // make sure the point is within the boundaries and return the point
1029 return new \Imagine\Image\Point(
1030 min(max($leftPos, 0), ($resizeSize->getWidth() - $cropSize->getWidth())),
#2
– /var/www/vhosts/tcs.benehosting.be/httpdocs/etc/plugins/imager/services/ImagerService.php(635): Craft\ImagerService->_getCropPoint(Imagine\Image\Box, Imagine\Image\Box, array("width" => 1200, "height" => 600, "mode" => "crop", "allowUpscale" => false, ...))
630 $layer->resize($resizeSize, $filterMethod);
631 }
632
633 // Do the crop
634 if (!isset($transform['mode']) || mb_strtolower($transform['mode']) === 'crop' || mb_strtolower($transform['mode']) === 'croponly') {
635 $cropPoint = $this->_getCropPoint($resizeSize, $cropSize, $transform);
636 $layer->crop($cropPoint, $cropSize);
637 }
638
639 // letterbox, add padding
640 if (isset($transform['mode']) && mb_strtolower($transform['mode']) === 'letterbox') {
#3
– /var/www/vhosts/tcs.benehosting.be/httpdocs/etc/plugins/imager/services/ImagerService.php(523): Craft\ImagerService->_transformLayer(Imagine\Imagick\Image, array("width" => 1200, "height" => 600, "mode" => "crop", "allowUpscale" => false, ...), "jpg", "jpg")
518 }
519
520 $this->imageInstance = $gif;
521
522 } else {
523 $this->_transformLayer($this->imageInstance, $transform, $sourceExtension, $targetExtension);
524 }
525
526 // If Image Driver is imagick and removeMetadata is true, remove meta data
527 if ($this->imageDriver === 'imagick' && $this->getSetting('removeMetadata', $transform)) {
528 $this->imageInstance->strip();
#4
– /var/www/vhosts/tcs.benehosting.be/httpdocs/etc/plugins/imager/services/ImagerService.php(341): Craft\ImagerService->_getTransformedImage(Craft\Imager_ImagePathsModel, array("width" => 1200, "height" => 600, "mode" => "crop", "allowUpscale" => false, ...))
336 $r = null;
337
338 if (isset($transform[0])) {
339 $transformedImages = array();
340 foreach ($transform as $t) {
341 $transformedImage = $this->_getTransformedImage($pathsModel, $transformDefaults != null ? array_merge($transformDefaults, $t) : $t);
342 $transformedImages[] = $transformedImage;
343 }
344 $r = $transformedImages;
345 } else {
346 $transformedImage = $this->_getTransformedImage($pathsModel, $transformDefaults != null ? array_merge($transformDefaults, (array)$transform) : $transform);
#5
– /var/www/vhosts/tcs.benehosting.be/httpdocs/etc/plugins/imager/variables/ImagerVariable.php(26): Craft\ImagerService->transformImage(Craft\AssetFileModel, array(array("width" => 1200, "ratio" => 2), array("width" => 1024, "ratio" => 2), array("width" => 768, "ratio" => 1.3333333333333, "jpegQuality" => 65)), array("format" => "jpg", "allowUpscale" => false, "mode" => "crop", "jpegQuality" => 80, ...), null)
21 * @param $configOverrides
22 * @return mixed
23 /
24 public function transformImage($file, $transform, $transformDefaults = null, $configOverrides = null)
25 {
26 $image = craft()->imager->transformImage($file, $transform, $transformDefaults, $configOverrides);
27 return $image;
28 }
29
30 /*
31 * Takes an array of Imager_ImageModel (or anything else that supports getUrl() and getWidth())
#6
- /var/www/vhosts/tcs.benehosting.be/httpdocs/etc/app/vendor/twig/twig/lib/Twig/Template.php(688): Craft\ImagerVariable->transformImage(Craft\AssetFileModel, array(array("width" => 1200, "ratio" => 2), array("width" => 1024, "ratio" => 2), array("width" => 768, "ratio" => 1.3333333333333, "jpegQuality" => 65)), array("format" => "jpg", "allowUpscale" => false, "mode" => "crop", "jpegQuality" => 80, ...)) #7
- /var/www/vhosts/tcs.benehosting.be/httpdocs/etc/app/etc/templating/BaseTemplate.php(64): Twig_Template->getAttribute(Craft\ImagerVariable, "transformImage", array(Craft\AssetFileModel, array(array("width" => 1200, "ratio" => 2), array("width" => 1024, "ratio" => 2), array("width" => 768, "ratio" => 1.3333333333333, "jpegQuality" => 65)), array("format" => "jpg", "allowUpscale" => false, "mode" => "crop", "jpegQuality" => 80, ...)), "method", ...) #8
- /var/www/vhosts/tcs.benehosting.be/httpdocs/etc/storage/runtime/compiled_templates/92/926c965f27f0a8639f5faab9eee97b03729329e5079cb4a55bbb874e3076993c.php(54): Craft\BaseTemplate->getAttribute(Craft\ImagerVariable, "transformImage", array(Craft\AssetFileModel, array(array("width" => 1200, "ratio" => 2), array("width" => 1024, "ratio" => 2), array("width" => 768, "ratio" => 1.3333333333333, "jpegQuality" => 65)), array("format" => "jpg", "allowUpscale" => false, "mode" => "crop", "jpegQuality" => 80, ...)), "method") #9
- /var/www/vhosts/tcs.benehosting.be/httpdocs/etc/app/vendor/twig/twig/lib/Twig/Template.php(432): __TwigTemplate_0d4faf44233d1ad63076843233cc6b8430ec6d6e5dba04bcb0069035591a81c8->doDisplay(array("entry" => Craft\EntryModel, "user" => Craft\UserModel, "currentUser" => Craft\UserModel, "craft" => Craft\CraftVariable, ...), array()) #10
- /var/www/vhosts/tcs.benehosting.be/httpdocs/etc/app/etc/templating/BaseTemplate.php(26): Twig_Template->displayWithErrorHandling(array("entry" => Craft\EntryModel, "user" => Craft\UserModel, "currentUser" => Craft\UserModel, "craft" => Craft\CraftVariable, ...), array()) #11
- /var/www/vhosts/tcs.benehosting.be/httpdocs/etc/app/vendor/twig/twig/lib/Twig/Template.php(403): Craft\BaseTemplate->displayWithErrorHandling(array("entry" => Craft\EntryModel, "user" => Craft\UserModel, "currentUser" => Craft\UserModel, "craft" => Craft\CraftVariable, ...), array()) #12
- /var/www/vhosts/tcs.benehosting.be/httpdocs/etc/storage/runtime/compiled_templates/ab/ab4d3d843badd622709bede0ca459e1a3905ae8ea79b7be2a6a720ba1df61684.php(83): Twig_Template->display(array("entry" => Craft\EntryModel, "user" => Craft\UserModel, "currentUser" => Craft\UserModel, "craft" => Craft\CraftVariable, ...)) #13
- /var/www/vhosts/tcs.benehosting.be/httpdocs/etc/app/vendor/twig/twig/lib/Twig/Template.php(432): __TwigTemplate_ec71d96e84090447984595a5eac82fd98239555cdecd2b027586bbae42a6d9c6->doDisplay(array("entry" => Craft\EntryModel, "user" => Craft\UserModel, "currentUser" => Craft\UserModel, "craft" => Craft\CraftVariable, ...), array("pilars" => array(__TwigTemplate_059b5d4cc341060a3a0bfcae3ce2d4a5e7c5f86429daf77b00387468a1fe7ff7, "block_pilars"), "content" => array(__TwigTemplate_059b5d4cc341060a3a0bfcae3ce2d4a5e7c5f86429daf77b00387468a1fe7ff7, "block_content"))) #14
- /var/www/vhosts/tcs.benehosting.be/httpdocs/etc/app/etc/templating/BaseTemplate.php(26): Twig_Template->displayWithErrorHandling(array("entry" => Craft\EntryModel, "user" => Craft\UserModel, "currentUser" => Craft\UserModel, "craft" => Craft\CraftVariable, ...), array("pilars" => array(__TwigTemplate_059b5d4cc341060a3a0bfcae3ce2d4a5e7c5f86429daf77b00387468a1fe7ff7, "block_pilars"), "content" => array(__TwigTemplate_059b5d4cc341060a3a0bfcae3ce2d4a5e7c5f86429daf77b00387468a1fe7ff7, "block_content"))) #15
- /var/www/vhosts/tcs.benehosting.be/httpdocs/etc/app/vendor/twig/twig/lib/Twig/Template.php(403): Craft\BaseTemplate->displayWithErrorHandling(array("entry" => Craft\EntryModel, "user" => Craft\UserModel, "currentUser" => Craft\UserModel, "craft" => Craft\CraftVariable, ...), array("pilars" => array(__TwigTemplate_059b5d4cc341060a3a0bfcae3ce2d4a5e7c5f86429daf77b00387468a1fe7ff7, "block_pilars"), "content" => array(__TwigTemplate_059b5d4cc341060a3a0bfcae3ce2d4a5e7c5f86429daf77b00387468a1fe7ff7, "block_content"))) #16
- /var/www/vhosts/tcs.benehosting.be/httpdocs/etc/storage/runtime/compiled_templates/03/034ce088b1330c1b7fce3077d29de9691abe9616805b1c11d4b598c22aac8ae5.php(31): Twig_Template->display(array("entry" => Craft\EntryModel, "user" => Craft\UserModel, "currentUser" => Craft\UserModel, "craft" => Craft\CraftVariable, ...), array("pilars" => array(__TwigTemplate_059b5d4cc341060a3a0bfcae3ce2d4a5e7c5f86429daf77b00387468a1fe7ff7, "block_pilars"), "content" => array(__TwigTemplate_059b5d4cc341060a3a0bfcae3ce2d4a5e7c5f86429daf77b00387468a1fe7ff7, "block_content"))) #17
- /var/www/vhosts/tcs.benehosting.be/httpdocs/etc/app/vendor/twig/twig/lib/Twig/Template.php(432): __TwigTemplate_059b5d4cc341060a3a0bfcae3ce2d4a5e7c5f86429daf77b00387468a1fe7ff7->doDisplay(array("entry" => Craft\EntryModel, "user" => Craft\UserModel, "currentUser" => Craft\UserModel, "craft" => Craft\CraftVariable, ...), array("pilars" => array(__TwigTemplate_059b5d4cc341060a3a0bfcae3ce2d4a5e7c5f86429daf77b00387468a1fe7ff7, "block_pilars"), "content" => array(__TwigTemplate_059b5d4cc341060a3a0bfcae3ce2d4a5e7c5f86429daf77b00387468a1fe7ff7, "block_content"))) #18
- /var/www/vhosts/tcs.benehosting.be/httpdocs/etc/app/etc/templating/BaseTemplate.php(26): Twig_Template->displayWithErrorHandling(array("entry" => Craft\EntryModel, "user" => Craft\UserModel, "currentUser" => Craft\UserModel, "craft" => Craft\CraftVariable, ...), array("pilars" => array(__TwigTemplate_059b5d4cc341060a3a0bfcae3ce2d4a5e7c5f86429daf77b00387468a1fe7ff7, "block_pilars"), "content" => array(__TwigTemplate_059b5d4cc341060a3a0bfcae3ce2d4a5e7c5f86429daf77b00387468a1fe7ff7, "block_content"))) #19
- /var/www/vhosts/tcs.benehosting.be/httpdocs/etc/app/vendor/twig/twig/lib/Twig/Template.php(403): Craft\BaseTemplate->displayWithErrorHandling(array("entry" => Craft\EntryModel, "user" => Craft\UserModel, "currentUser" => Craft\UserModel, "craft" => Craft\CraftVariable, ...), array("pilars" => array(__TwigTemplate_059b5d4cc341060a3a0bfcae3ce2d4a5e7c5f86429daf77b00387468a1fe7ff7, "block_pilars"), "content" => array(__TwigTemplate_059b5d4cc341060a3a0bfcae3ce2d4a5e7c5f86429daf77b00387468a1fe7ff7, "block_content"))) #20
- /var/www/vhosts/tcs.benehosting.be/httpdocs/etc/app/vendor/twig/twig/lib/Twig/Template.php(411): Twig_Template->display(array("entry" => Craft\EntryModel)) #21
- /var/www/vhosts/tcs.benehosting.be/httpdocs/etc/app/vendor/twig/twig/lib/Twig/Environment.php(362): Twig_Template->render(array("entry" => Craft\EntryModel)) #22
- /var/www/vhosts/tcs.benehosting.be/httpdocs/etc/app/services/TemplatesService.php(256): Twig_Environment->render("index", array("entry" => Craft\EntryModel)) #23
- /var/www/vhosts/tcs.benehosting.be/httpdocs/etc/app/controllers/BaseController.php(74): Craft\TemplatesService->render("index", array("entry" => Craft\EntryModel)) #24
- /var/www/vhosts/tcs.benehosting.be/httpdocs/etc/app/controllers/TemplatesController.php(68): Craft\BaseController->renderTemplate("index", array("entry" => Craft\EntryModel)) #25 unknown(0): Craft\TemplatesController->actionRender("index", array("entry" => Craft\EntryModel)) #26
- /var/www/vhosts/tcs.benehosting.be/httpdocs/etc/app/framework/web/actions/CAction.php(109): ReflectionMethod->invokeArgs(Craft\TemplatesController, array("index", array("entry" => Craft\EntryModel))) #27
- /var/www/vhosts/tcs.benehosting.be/httpdocs/etc/app/framework/web/actions/CInlineAction.php(47): CAction->runWithParamsInternal(Craft\TemplatesController, ReflectionMethod, array("variables" => array("entry" => Craft\EntryModel), "template" => "index")) #28
- /var/www/vhosts/tcs.benehosting.be/httpdocs/etc/app/framework/web/CController.php(308): CInlineAction->runWithParams(array("variables" => array("entry" => Craft\EntryModel), "template" => "index")) #29
- /var/www/vhosts/tcs.benehosting.be/httpdocs/etc/app/framework/web/CController.php(286): CController->runAction(CInlineAction) #30
- /var/www/vhosts/tcs.benehosting.be/httpdocs/etc/app/framework/web/CController.php(265): CController->runActionWithFilters(CInlineAction, array()) #31
- /var/www/vhosts/tcs.benehosting.be/httpdocs/etc/app/framework/web/CWebApplication.php(282): CController->run("render") #32
- /var/www/vhosts/tcs.benehosting.be/httpdocs/etc/app/framework/web/CWebApplication.php(141): CWebApplication->runController("templates/render") #33
- /var/www/vhosts/tcs.benehosting.be/httpdocs/etc/app/etc/web/WebApp.php(290): CWebApplication->processRequest() #34
- /var/www/vhosts/tcs.benehosting.be/httpdocs/etc/app/framework/base/CApplication.php(185): Craft\WebApp->processRequest() #35
- /var/www/vhosts/tcs.benehosting.be/httpdocs/etc/app/index.php(62): CApplication->run() #36
- /var/www/vhosts/tcs.benehosting.be/httpdocs/index.php(17): require_once("/var/www/vhosts/tcs.benehosting.be/httpdocs/etc/app/index.php")
"A non-numeric value encountered" /var/www/vhosts/xxx/httpdocs/etc/plugins/imager/services/ImagerService.php(1025)
1013 * @param $transform
1014 * @return \Imagine\Image\Point
1015 */
1016 private function _getCropPoint($resizeSize, $cropSize, $transform)
1017 {
1018 // get default crop position from the settings
1019 $position = $this->getSetting('position', $transform);
1020
1021 // get the offsets, left and top, now as an int, representing the % offset
1022 list($leftOffset, $topOffset) = explode(' ', $position);
1023
1024 // get position that crop should center around
1025 $leftPos = floor($resizeSize->getWidth() * ($leftOffset / 100)) - floor($cropSize->getWidth()/2);
1026 $topPos = floor($resizeSize->getHeight() * ($topOffset / 100)) - floor($cropSize->getHeight()/2);
1027
1028 // make sure the point is within the boundaries and return the point
1029 return new \Imagine\Image\Point(
1030 min(max($leftPos, 0), ($resizeSize->getWidth() - $cropSize->getWidth())),
1031 min(max($topPos, 0), ($resizeSize->getHeight() - $cropSize->getHeight()))
1032 );
1033 }
1034
1035
1036 /**
1037 * Returns the filter method for resize operations
Stack Trace
- 0
– /var/www/vhosts/xxx/httpdocs/etc/app/etc/web/WebApp.php(693): CApplication->handleError(2, "A non-numeric value encountered", "/var/www/vhosts//httpdocs/etc/plugins/imager/s...", 1025)
688 if (version_compare(PHP_VERSION, '7.1', '>=') && strpos($message, 'Narrowing occurred during type inference. Please file a bug report') !== false)
689 {
690 return;
691 }
692
693 parent::handleError($code, $message, $file, $line);
694 }
695
696 // Private Methods
697 // =========================================================================
698
- 1
– /var/www/vhosts/xxx/httpdocs/etc/plugins/imager/services/ImagerService.php(1025): Craft\WebApp->handleError(2, "A non-numeric value encountered", "/var/www/vhosts/xxx/httpdocs/etc/plugins/imager/s...", 1025, ...)
1020
1021 // get the offsets, left and top, now as an int, representing the % offset
1022 list($leftOffset, $topOffset) = explode(' ', $position);
1023
1024 // get position that crop should center around
1025 $leftPos = floor($resizeSize->getWidth() * ($leftOffset / 100)) - floor($cropSize->getWidth()/2);
1026 $topPos = floor($resizeSize->getHeight() * ($topOffset / 100)) - floor($cropSize->getHeight()/2);
1027
1028 // make sure the point is within the boundaries and return the point
1029 return new \Imagine\Image\Point(
1030 min(max($leftPos, 0), ($resizeSize->getWidth() - $cropSize->getWidth())),
- 2
– /var/www/vhosts/xxx/httpdocs/etc/plugins/imager/services/ImagerService.php(635): Craft\ImagerService->_getCropPoint(Imagine\Image\Box, Imagine\Image\Box, array("width" => 1200, "height" => 600, "mode" => "crop", "allowUpscale" => false, ...))
630 $layer->resize($resizeSize, $filterMethod);
631 }
632
633 // Do the crop
634 if (!isset($transform['mode']) || mb_strtolower($transform['mode']) === 'crop' || mb_strtolower($transform['mode']) === 'croponly') {
635 $cropPoint = $this->_getCropPoint($resizeSize, $cropSize, $transform);
636 $layer->crop($cropPoint, $cropSize);
637 }
638
639 // letterbox, add padding
640 if (isset($transform['mode']) && mb_strtolower($transform['mode']) === 'letterbox') {
- 3
– /var/www/vhosts/xxx/httpdocs/etc/plugins/imager/services/ImagerService.php(523): Craft\ImagerService->_transformLayer(Imagine\Imagick\Image, array("width" => 1200, "height" => 600, "mode" => "crop", "allowUpscale" => false, ...), "jpg", "jpg")
518 }
519
520 $this->imageInstance = $gif;
521
522 } else {
523 $this->_transformLayer($this->imageInstance, $transform, $sourceExtension, $targetExtension);
524 }
525
526 // If Image Driver is imagick and removeMetadata is true, remove meta data
527 if ($this->imageDriver === 'imagick' && $this->getSetting('removeMetadata', $transform)) {
528 $this->imageInstance->strip();
- 6
– /var/www/vhosts/xxx/httpdocs/etc/plugins/imager/services/ImagerService.php(341): Craft\ImagerService->_getTransformedImage(Craft\Imager_ImagePathsModel, array("width" => 1200, "height" => 600, "mode" => "crop", "allowUpscale" => false, ...))
336 $r = null;
337
338 if (isset($transform[0])) {
339 $transformedImages = array();
340 foreach ($transform as $t) {
341 $transformedImage = $this->_getTransformedImage($pathsModel, $transformDefaults != null ? array_merge($transformDefaults, $t) : $t);
342 $transformedImages[] = $transformedImage;
343 }
344 $r = $transformedImages;
345 } else {
346 $transformedImage = $this->_getTransformedImage($pathsModel, $transformDefaults != null ? array_merge($transformDefaults, (array)$transform) : $transform);
- 5
– /var/www/vhosts/xxx/httpdocs/etc/plugins/imager/variables/ImagerVariable.php(26): Craft\ImagerService->transformImage(Craft\AssetFileModel, array(array("width" => 1200, "ratio" => 2), array("width" => 1024, "ratio" => 2), array("width" => 768, "ratio" => 1.3333333333333, "jpegQuality" => 65)), array("format" => "jpg", "allowUpscale" => false, "mode" => "crop", "jpegQuality" => 80, ...), null)
21 * @param $configOverrides
22 * @return mixed
23 */
24 public function transformImage($file, $transform, $transformDefaults = null, $configOverrides = null)
25 {
26 $image = craft()->imager->transformImage($file, $transform, $transformDefaults, $configOverrides);
27 return $image;
28 }
29
30 /**
31 * Takes an array of Imager_ImageModel (or anything else that supports getUrl() and getWidth())
...
...