Checking image thumbnail, please wait ...

Phoca Cart - complex e-commerce extension
orangia
Phoca Newbie
Phoca Newbie
Posts: 6
Joined: 13 Oct 2023, 12:16

Checking image thumbnail, please wait ...

Post 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!

Tags:
User avatar
Benno
Phoca Hero
Phoca Hero
Posts: 9448
Joined: 04 Dec 2008, 11:58
Location: Germany
Contact:

Re: Checking image thumbnail, please wait ...

Post 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
orangia
Phoca Newbie
Phoca Newbie
Posts: 6
Joined: 13 Oct 2023, 12:16

Re: Checking image thumbnail, please wait ...

Post 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
User avatar
Benno
Phoca Hero
Phoca Hero
Posts: 9448
Joined: 04 Dec 2008, 11:58
Location: Germany
Contact:

Re: Checking image thumbnail, please wait ...

Post 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
  • Ready for Joomla 4.3.3
  • Tested in Joomla 5
  • Ready for PHP 8.2
Phoca Cart v4.0.8 works with PHP v8.2 :idea:

Kind regards,
Benno
orangia
Phoca Newbie
Phoca Newbie
Posts: 6
Joined: 13 Oct 2023, 12:16

Re: Checking image thumbnail, please wait ...

Post 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
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 48402
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: Checking image thumbnail, please wait ...

Post 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
If you find Phoca extensions useful, please support the project
orangia
Phoca Newbie
Phoca Newbie
Posts: 6
Joined: 13 Oct 2023, 12:16

Re: Checking image thumbnail, please wait ...

Post 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;
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 48402
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: Checking image thumbnail, please wait ...

Post 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
If you find Phoca extensions useful, please support the project
orangia
Phoca Newbie
Phoca Newbie
Posts: 6
Joined: 13 Oct 2023, 12:16

Re: Checking image thumbnail, please wait ...

Post 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
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 48402
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: Checking image thumbnail, please wait ...

Post by Jan »

Hi, the height is set to "auto" value. Did you set "auto" instead of number value in options?

Image

Jan
If you find Phoca extensions useful, please support the project
Post Reply