Page 1 of 2
Checking image thumbnail, please wait ...
Posted: 13 Oct 2023, 12:37
by orangia
I use Phoca cart 4.0.8 on Joomla 4.3.4 and PHP 8.2.8. Let me know if you need more info.
I receive this popup for a very long time when I try to upload an image in a product: "Checking image thumbnail, please wait ...". If I try to save anyway I get an error: "Unsupported operand types: string / int".
If anyone has a solution, I am so grateful!
Re: Checking image thumbnail, please wait ...
Posted: 14 Oct 2023, 16:20
by Benno
Hi,
If I try to save anyway I get an error: "Unsupported operand types: string / int".
Set the Joomla! error reporting to maximum and activate the Joomla! debug mode to get an error message with the file and line where the error is located. Then please post the complete 'Call Stack'.
Kind regards,
Benno
Re: Checking image thumbnail, please wait ...
Posted: 17 Oct 2023, 09:49
by orangia
Thank you for answering Benno, sorry for the delay!
I found a similar issue for someone that uses Phoca gallery and the solution was to downgrade the php to 7.4.33. So I did and now it works. So I guess it has to do with that Phoca cart only works with older php. I hope this will get fixed in a coming update.
Should this not be the solution? Let me know and I will take back the php to 8.2.8 and set the error reporting to check this further!
Regards, Johanna
Re: Checking image thumbnail, please wait ...
Posted: 17 Oct 2023, 10:02
by Benno
Hi,
Should this not be the solution? Let me know and I will take back the php to 8.2.8 and set the error reporting to check this further!
see:
https://www.phoca.cz/news/1265-phoca-ca ... 8-released
Phoca Cart v4.0.8 works with PHP v8.2
Kind regards,
Benno
Re: Checking image thumbnail, please wait ...
Posted: 17 Oct 2023, 11:53
by orangia
Hi, I have now set the error reporting. This is the call stack I get after trying to save the product (even if the checking image thumbnail is still there waiting).
# Function Location
1 () JROOT/administrator/components/com_phocacart/libraries/phocacart/image/magic.php:83
2 PhocacartImageMagic::imageMagic() JROOT/administrator/components/com_phocacart/libraries/phocacart/file/thumbnail.php:417
3 PhocacartFileThumbnail::createFileThumbnail() JROOT/administrator/components/com_phocacart/libraries/phocacart/file/thumbnail.php:210
4 PhocacartFileThumbnail::getOrCreateThumbnail() JROOT/administrator/components/com_phocacart/libraries/phocacart/image/additional.php:93
5 PhocacartImageAdditional::storeImagesByProductId() JROOT/administrator/components/com_phocacart/models/phocacartitem.php:512
6 PhocaCartCpModelPhocaCartItem->save() JROOT/libraries/src/MVC/Controller/FormController.php:675
7 Joomla\CMS\MVC\Controller\FormController->save() JROOT/libraries/src/MVC/Controller/BaseController.php:678
8 Joomla\CMS\MVC\Controller\BaseController->execute() JROOT/administrator/components/com_phocacart/phocacart.php:28
9 require_once() JROOT/libraries/src/Dispatcher/LegacyComponentDispatcher.php:71
10 Joomla\CMS\Dispatcher\LegacyComponentDispatcher::Joomla\CMS\Dispatcher\{closure}() JROOT/libraries/src/Dispatcher/LegacyComponentDispatcher.php:73
11 Joomla\CMS\Dispatcher\LegacyComponentDispatcher->dispatch() JROOT/libraries/src/Component/ComponentHelper.php:361
12 Joomla\CMS\Component\ComponentHelper::renderComponent() JROOT/libraries/src/Application/AdministratorApplication.php:143
13 Joomla\CMS\Application\AdministratorApplication->dispatch() JROOT/libraries/src/Application/AdministratorApplication.php:186
14 Joomla\CMS\Application\AdministratorApplication->doExecute() JROOT/libraries/src/Application/CMSApplication.php:293
15 Joomla\CMS\Application\CMSApplication->execute() JROOT/administrator/includes/app.php:61
16 require_once() JROOT/administrator/index.php:32
Re: Checking image thumbnail, please wait ...
Posted: 18 Oct 2023, 16:41
by Jan
Hi, can you on line 83, where the error comes debug the variables:
e.g. with print_r (the should be displayed in console):
Code: Select all
echo "$w: ";
print_r($w);
echo "$width: ";
print_r($width);
echo "$h: ";
print_r($h);
echo "$height: ";
print_r($height);
$scale = (($width / $w) < ($height / $h)) ? ($width / $w) : ($height / $h); // smaller rate
Re: Checking image thumbnail, please wait ...
Posted: 19 Oct 2023, 09:16
by orangia
Hi! The code from line 81 is like this. All above that in your code (echo "$w: "; print_r($w); and so on) I can't find in the file!
Code: Select all
// miniaturizing
if (!$crop) { // new size - nw, nh (new width/height)
$scale = (($width / $w) < ($height / $h)) ? ($width / $w) : ($height / $h); // smaller rate
$src = array(0,0, $w, $h);
$dst = array(0,0, floor($w*$scale), floor($h*$scale));
}
else { // will be cropped
$scale = (($width / $w) > ($height / $h)) ? ($width / $w) : ($height / $h); // greater rate
$newW = $width/$scale; // check the size of in file
$newH = $height/$scale;
Re: Checking image thumbnail, please wait ...
Posted: 20 Oct 2023, 16:13
by Jan
Hi, you should add them (the lines listed in previous post), so it will print the debug information for you.
JROOT/administrator/components/com_phocacart/libraries/phocacart/image/magic.php:83
You can even test to add exit there:
echo "$height: ";
print_r($height);
exit;
so the console will write the code and stop.
Jan
Re: Checking image thumbnail, please wait ...
Posted: 23 Oct 2023, 09:25
by orangia
Hi!
When adding exit; after this is the error message: 900: 900460: 4601667: 1667auto: auto
Without the exit; this is the Call stack:
1 () JROOT/administrator/components/com_phocacart/libraries/phocacart/image/magic.php:91
2 PhocacartImageMagic::imageMagic() JROOT/administrator/components/com_phocacart/libraries/phocacart/file/thumbnail.php:417
3 PhocacartFileThumbnail::createFileThumbnail() JROOT/administrator/components/com_phocacart/libraries/phocacart/file/thumbnail.php:210
4 PhocacartFileThumbnail::getOrCreateThumbnail() JROOT/administrator/components/com_phocacart/libraries/phocacart/image/additional.php:93
5 PhocacartImageAdditional::storeImagesByProductId() JROOT/administrator/components/com_phocacart/models/phocacartitem.php:512
6 PhocaCartCpModelPhocaCartItem->save() JROOT/libraries/src/MVC/Controller/FormController.php:676
7 Joomla\CMS\MVC\Controller\FormController->save() JROOT/libraries/src/MVC/Controller/BaseController.php:693
8 Joomla\CMS\MVC\Controller\BaseController->execute() JROOT/administrator/components/com_phocacart/phocacart.php:28
9 require_once() JROOT/libraries/src/Dispatcher/LegacyComponentDispatcher.php:71
10 Joomla\CMS\Dispatcher\LegacyComponentDispatcher::Joomla\CMS\Dispatcher\{closure}() JROOT/libraries/src/Dispatcher/LegacyComponentDispatcher.php:73
11 Joomla\CMS\Dispatcher\LegacyComponentDispatcher->dispatch() JROOT/libraries/src/Component/ComponentHelper.php:361
12 Joomla\CMS\Component\ComponentHelper::renderComponent() JROOT/libraries/src/Application/AdministratorApplication.php:143
13 Joomla\CMS\Application\AdministratorApplication->dispatch() JROOT/libraries/src/Application/AdministratorApplication.php:186
14 Joomla\CMS\Application\AdministratorApplication->doExecute() JROOT/libraries/src/Application/CMSApplication.php:293
15 Joomla\CMS\Application\CMSApplication->execute() JROOT/administrator/includes/app.php:61
16 require_once() JROOT/administrator/index.php:32
Re: Checking image thumbnail, please wait ...
Posted: 23 Oct 2023, 12:41
by Jan
Hi, the height is set to "auto" value. Did you set "auto" instead of number value in options?
Jan