[V4.3.4] Issue With Image Resizing After Creating Product

After creating a product with images, I am getting the following issue:

Error Log:

PHP Fatal error:  Call to a member function open() on a non-object in /var/www/html/app/functions/fn.images.php on line 635, referer: http://[REDACTED]/admin.php?dispatch=products.update&product_id=1
PHP Stack trace:, referer: http://[REDACTED]/admin.php?dispatch=products.update&product_id=1
PHP   1. {main}() /var/www/html/admin.php:0, referer: http://[REDACTED]/admin.php?dispatch=products.update&product_id=1
PHP   2. fn_dispatch() /var/www/html/admin.php:27, referer: http://[REDACTED]/admin.php?dispatch=products.update&product_id=1
PHP   3. Tygh\\SmartyEngine\\Core->display() /var/www/html/app/functions/fn.control.php:611, referer: http://[REDACTED]/admin.php?dispatch=products.update&product_id=1
PHP   4. Smarty_Internal_TemplateBase->display() /var/www/html/app/Tygh/SmartyEngine/Core.php:52, referer: http://[REDACTED]/admin.php?dispatch=products.update&product_id=1
PHP   5. Tygh\\SmartyEngine\\Core->fetch() /var/www/html/app/lib/vendor/smarty/smarty/libs/sysplugins/smarty_internal_templatebase.php:394, referer: http://[REDACTED]/admin.php?dispatch=products.update&product_id=1
PHP   6. Smarty_Internal_TemplateBase->fetch() /var/www/html/app/Tygh/SmartyEngine/Core.php:68, referer: http://[REDACTED]/admin.php?dispatch=products.update&product_id=1
PHP   7. content_55fcaa44d5b4e6_74786694() /var/www/html/app/lib/vendor/smarty/smarty/libs/sysplugins/smarty_internal_templatebase.php:188, referer: http://[REDACTED]/admin.php?dispatch=products.update&product_id=1
PHP   8. Smarty_Internal_Template->getSubTemplate() /var/www/html/var/cache/templates/backend/b7653ad23fbf3b58e8f2d99ec0214681ac8cffda.tygh.index.tpl.php:81, referer: http://[REDACTED]/admin.php?dispatch=products.update&product_id=1
PHP   9. Smarty_Internal_TemplateBase->fetch() /var/www/html/app/lib/vendor/smarty/smarty/libs/sysplugins/smarty_internal_template.php:304, referer: http://[REDACTED]/admin.php?dispatch=products.update&product_id=1
PHP  10. content_55fcac050e80e7_63702130() /var/www/html/app/lib/vendor/smarty/smarty/libs/sysplugins/smarty_internal_templatebase.php:188, referer: http://[REDACTED]/admin.php?dispatch=products.update&product_id=1
PHP  11. Smarty_Internal_Template->getSubTemplate() /var/www/html/var/cache/templates/backend/86b97ab2ecd36a14d58371d2b8b0ccc520293b3c.tygh.manage.tpl.php:194, referer: http://[REDACTED]/admin.php?dispatch=products.update&product_id=1
PHP  12. Smarty_Internal_TemplateBase->fetch() /var/www/html/app/lib/vendor/smarty/smarty/libs/sysplugins/smarty_internal_template.php:304, referer: http://[REDACTED]/admin.php?dispatch=products.update&product_id=1
PHP  13. content_55fcb1e03d7071_99745455() /var/www/html/app/lib/vendor/smarty/smarty/libs/sysplugins/smarty_internal_templatebase.php:188, referer: http://[REDACTED]/admin.php?dispatch=products.update&product_id=1
PHP  14. fn_image_to_display() /var/www/html/var/cache/templates/backend/30cb74cec3a2175b314961ef6ca3beb0fceec881.tygh.image.tpl.php:34, referer: http://[REDACTED]/admin.php?dispatch=products.update&product_id=1
PHP  15. fn_generate_thumbnail() /var/www/html/app/functions/fn.images.php:949, referer: http://[REDACTED]/admin.php?dispatch=products.update&product_id=1
PHP  16. fn_resize_image() /var/www/html/app/functions/fn.images.php:871, referer: http://[REDACTED]/admin.php?dispatch=products.update&product_id=1

Every time I try to go to the products page, the page is broken (see attachment).

Also on the storefront, I am getting the store_closed.html page (because of the above error).

The line in question (app/functions/fn.images.php):

function fn_resize_image($src, $new_width = 0, $new_height = 0, $bg_color = '#ffffff', $custom_settings = array())
{
    static $general_settings = array();
    if (empty($general_settings)) {
        $general_settings = Settings::instance()->getValues('Thumbnails');
    }
gc_collect_cycles();

$settings = empty($custom_settings) ? $general_settings : $custom_settings;

/** @var \Imagine\Image\ImagineInterface $imagine */
$imagine = Tygh::$app['image'];</pre>

Note: I installed php5-gd, is there something else that I'm missing?

Thanks!

Screen Shot 2015-09-18 at 6.26.13 PM.png

Any update ?

After creating a product with images, I am getting the following issue:

Error Log:

PHP Fatal error:  Call to a member function open() on a non-object in /var/www/html/app/functions/fn.images.php on line 635, referer: http://[REDACTED]/admin.php?dispatch=products.update&product_id=1
PHP Stack trace:, referer: http://[REDACTED]/admin.php?dispatch=products.update&product_id=1
PHP   1. {main}() /var/www/html/admin.php:0, referer: http://[REDACTED]/admin.php?dispatch=products.update&product_id=1
PHP   2. fn_dispatch() /var/www/html/admin.php:27, referer: http://[REDACTED]/admin.php?dispatch=products.update&product_id=1
PHP   3. Tygh\\SmartyEngine\\Core->display() /var/www/html/app/functions/fn.control.php:611, referer: http://[REDACTED]/admin.php?dispatch=products.update&product_id=1
PHP   4. Smarty_Internal_TemplateBase->display() /var/www/html/app/Tygh/SmartyEngine/Core.php:52, referer: http://[REDACTED]/admin.php?dispatch=products.update&product_id=1
PHP   5. Tygh\\SmartyEngine\\Core->fetch() /var/www/html/app/lib/vendor/smarty/smarty/libs/sysplugins/smarty_internal_templatebase.php:394, referer: http://[REDACTED]/admin.php?dispatch=products.update&product_id=1
PHP   6. Smarty_Internal_TemplateBase->fetch() /var/www/html/app/Tygh/SmartyEngine/Core.php:68, referer: http://[REDACTED]/admin.php?dispatch=products.update&product_id=1
PHP   7. content_55fcaa44d5b4e6_74786694() /var/www/html/app/lib/vendor/smarty/smarty/libs/sysplugins/smarty_internal_templatebase.php:188, referer: http://[REDACTED]/admin.php?dispatch=products.update&product_id=1
PHP   8. Smarty_Internal_Template->getSubTemplate() /var/www/html/var/cache/templates/backend/b7653ad23fbf3b58e8f2d99ec0214681ac8cffda.tygh.index.tpl.php:81, referer: http://[REDACTED]/admin.php?dispatch=products.update&product_id=1
PHP   9. Smarty_Internal_TemplateBase->fetch() /var/www/html/app/lib/vendor/smarty/smarty/libs/sysplugins/smarty_internal_template.php:304, referer: http://[REDACTED]/admin.php?dispatch=products.update&product_id=1
PHP  10. content_55fcac050e80e7_63702130() /var/www/html/app/lib/vendor/smarty/smarty/libs/sysplugins/smarty_internal_templatebase.php:188, referer: http://[REDACTED]/admin.php?dispatch=products.update&product_id=1
PHP  11. Smarty_Internal_Template->getSubTemplate() /var/www/html/var/cache/templates/backend/86b97ab2ecd36a14d58371d2b8b0ccc520293b3c.tygh.manage.tpl.php:194, referer: http://[REDACTED]/admin.php?dispatch=products.update&product_id=1
PHP  12. Smarty_Internal_TemplateBase->fetch() /var/www/html/app/lib/vendor/smarty/smarty/libs/sysplugins/smarty_internal_template.php:304, referer: http://[REDACTED]/admin.php?dispatch=products.update&product_id=1
PHP  13. content_55fcb1e03d7071_99745455() /var/www/html/app/lib/vendor/smarty/smarty/libs/sysplugins/smarty_internal_templatebase.php:188, referer: http://[REDACTED]/admin.php?dispatch=products.update&product_id=1
PHP  14. fn_image_to_display() /var/www/html/var/cache/templates/backend/30cb74cec3a2175b314961ef6ca3beb0fceec881.tygh.image.tpl.php:34, referer: http://[REDACTED]/admin.php?dispatch=products.update&product_id=1
PHP  15. fn_generate_thumbnail() /var/www/html/app/functions/fn.images.php:949, referer: http://[REDACTED]/admin.php?dispatch=products.update&product_id=1
PHP  16. fn_resize_image() /var/www/html/app/functions/fn.images.php:871, referer: http://[REDACTED]/admin.php?dispatch=products.update&product_id=1

Every time I try to go to the products page, the page is broken (see attachment).

Also on the storefront, I am getting the store_closed.html page (because of the above error).

The line in question (app/functions/fn.images.php):

function fn_resize_image($src, $new_width = 0, $new_height = 0, $bg_color = '#ffffff', $custom_settings = array())
{
    static $general_settings = array();
    if (empty($general_settings)) {
        $general_settings = Settings::instance()->getValues('Thumbnails');
    }
gc_collect_cycles();

$settings = empty($custom_settings) ? $general_settings : $custom_settings;

/** @var \Imagine\Image\ImagineInterface $imagine */
$imagine = Tygh::$app['image'];

Note: I installed php5-gd, is there something else that I'm missing?

Thanks!

Any update ?

It seems that either the GD or ImageMagick graphics libraries, which are used by CS-Cart for generating image thumbnails, are not installed or incorrectly installed on the server. Please note that the GD library should be installed with the FreeType support.

Does app/lib/vendor/imagine/imagine/lib/Imagine/Image/ImagineInterface.php exist?

In the config.local.php file try to replace:

'image_resize_lib' => 'auto',

with

'image_resize_lib' => 'gd',

Does app/lib/vendor/imagine/imagine/lib/Imagine/Image/ImagineInterface.php exist?

We install GD on server now website frontend open correct but problem is some error showing on product page like this :

PHP Notice Message

Undefined variable: only_selectable

Error at

app/addons/custom_dev/func.php, line: 52

Backtrace File: app/addons/custom_dev/func.php Line: 52 Function: {closure} File: app/functions/fn.control.php Line: 143 Function: fn_custom_dev_get_product_options File: app/functions/fn.catalog.php Line: 3109 Function: fn_set_hook File: app/functions/fn.catalog.php Line: 539 Function: fn_get_product_options File: app/functions/fn.catalog.php Line: 861 Function: fn_gather_additional_products_data File: app/controllers/frontend/products.php Line: 143 Function: fn_gather_additional_product_data File: app/functions/fn.control.php Line: 699 Function: include File: app/functions/fn.control.php Line: 455 Function:fn_run_controller File: index.php Line: 25 Function: fn_dispatch
PHP Notice Message

Undefined variable: inventory

Error at

app/addons/custom_dev/func.php, line: 55

Backtrace File: app/addons/custom_dev/func.php Line: 55 Function: {closure} File: app/functions/fn.control.php Line: 143 Function: fn_custom_dev_get_product_options File: app/functions/fn.catalog.php Line: 3109 Function: fn_set_hook File: app/functions/fn.catalog.php Line: 539 Function: fn_get_product_options File: app/functions/fn.catalog.php Line: 861 Function: fn_gather_additional_products_data File: app/controllers/frontend/products.php Line: 143 Function: fn_gather_additional_product_data File: app/functions/fn.control.php Line: 699 Function: include File: app/functions/fn.control.php Line: 455 Function:fn_run_controller File: index.php Line: 25 Function: fn_dispatch

It seems that either the GD or ImageMagick graphics libraries, which are used by CS-Cart for generating image thumbnails, are not installed or incorrectly installed on the server. Please note that the GD library should be installed with the FreeType support.


We install GD on server now website frontend open correct but problem is some error showing on product page like this :

PHP Notice Message

Undefined variable: only_selectable

Error at

app/addons/custom_dev/func.php, line: 52

Backtrace File: app/addons/custom_dev/func.php Line: 52 Function: {closure} File: app/functions/fn.control.php Line: 143 Function: fn_custom_dev_get_product_options File: app/functions/fn.catalog.php Line: 3109 Function: fn_set_hook File: app/functions/fn.catalog.php Line: 539 Function: fn_get_product_options File: app/functions/fn.catalog.php Line: 861 Function: fn_gather_additional_products_data File: app/controllers/frontend/products.php Line: 143 Function: fn_gather_additional_product_data File: app/functions/fn.control.php Line: 699 Function: include File: app/functions/fn.control.php Line: 455 Function: fn_run_controller File: index.php Line: 25 Function: fn_dispatch
PHP Notice Message

Undefined variable: inventory

Error at

app/addons/custom_dev/func.php, line: 55

Backtrace File: app/addons/custom_dev/func.php Line: 55 Function: {closure} File: app/functions/fn.control.php Line: 143 Function: fn_custom_dev_get_product_options File: app/functions/fn.catalog.php Line: 3109 Function: fn_set_hook File: app/functions/fn.catalog.php Line: 539 Function: fn_get_product_options File: app/functions/fn.catalog.php Line: 861 Function: fn_gather_additional_products_data File: app/controllers/frontend/products.php Line: 143 Function: fn_gather_additional_product_data File: app/functions/fn.control.php Line: 699 Function: include File: app/functions/fn.control.php Line: 455 Function: fn_run_controller File: index.php Line: 25 Function: fn_dispatch

Contact the developer of the custom_dev addon.

Agree, the issue is not related with image resizing, but with 3rd party module