Jump to content
thirty bees forum
  • 0

CSV product import failing on 1.0.3


Question

5 answers to this question

Recommended Posts

  • 0
Posted

On further investigation I found that it has something to do with the imagemagick module. When I tried to reverse the sort direction of the products in the back office it returned a 500 server error. I decrypted the error and it started with

ThirtyBeesException

**Premature end of JPEG file store/img/p/4/2/1/3/4213.jpg' @ error/jpeg.c/JPEGErrorHandler/322** *at line* **43** *in file*override/classes/ImageManager.php```php 38. } 39. if ($regenerate || !file_exists(_PS_TMP_IMG_DIR_.$cacheImage)) { 40. if (!parent::checkImageMemoryLimit($image)) { 41. return ''; 42. } 43. => $srcImage = new Imagick($image); 44. self::trimImage($srcImage); 45. $x = $srcImage->getImageWidth(); 46. $y = $srcImage->getImageHeight(); 47. $maxX = $size * 3; 48. $ratioX = $x / ($y / $size); ``` - **Imagick->__construct** - [line43-override/classes/ImageManager.php] - [1 Arguments] ```php 38. } 39. if ($regenerate || !file_exists(_PS_TMP_IMG_DIR_.$cacheImage)) { 40. if (!parent::checkImageMemoryLimit($image)) { 41. return ''; 42. } 43. => $srcImage = new Imagick($image); 44. self::trimImage($srcImage); 45. $x = $srcImage->getImageWidth(); 46. $y = $srcImage->getImageHeight(); 47. $maxX = $size * 3; 48. $ratioX = $x / ($y / $size); ``` ```Argument [0] /store/img/p/4/2/1/3/4213.jpg ``` - **ImageManager::thumbnail** - [line519-classes/helper/HelperList.php] - [4 Arguments] ```php 514. if ($params['image'] != 'p' || Configuration::get('PS_LEGACY_IMAGES')) { 515. $pathToImage = _PS_IMG_DIR_.$params['image'].'/'.$itemId.(isset($tr['id_image']) ? '-'.(int) $tr['id_image'] : '').'.'.$this->imageType; 516. } else { 517. $pathToImage = _PS_IMG_DIR_.$params['image'].'/'.Image::getImgFolderStatic($tr['id_image']).(int) $tr['id_image'].'.'.$this->imageType; 518. } 519. => $this->_list[$index][$key] = ImageManager::thumbnail($pathToImage, $this->table.'_mini_'.$itemId.'_'.$this->context->shop->id.'.'.$this->imageType, 45, $this->imageType); 520. } elseif (isset($params['icon']) && isset($tr[$key]) && (isset($params['icon'][$tr[$key]]) || isset($params['icon']['default']))) { 521. if (!$this->bootstrap) { 522. if (isset($params['icon'][$tr[$key]]) && is_array($params['icon'][$tr[$key]])) { 523. $this->_list[$index][$key] = [ 524. 'src' => $params['icon'][$tr[$key]]['src'], ``` ```Argument [0] store/img/p/4/2/1/3/4213.jpg Argument [1] product_mini_1350_1.jpg Argument [2] 45 Argument [3] jpg ``` - **HelperListCore->displayListContent** - [line154-classes/helper/HelperList.php`]
php 149. $this->orderWay = preg_replace('/^([a-z _]*!)/Ui', '', $this->orderWay); 150. 151. $this->tpl->assign( 152. [ 153. 'header' => $this->displayListHeader(), // Display list header (filtering, pagination and column names) 154. => 'content' => $this->displayListContent(), // Show the content of the table 155. 'footer' => $this->displayListFooter(), // Close list table and submit button 156. ] 157. ); 158. 159. return parent::generate();
- * I disabled the Imagemagick module and the upload was successful - sort of. About half of the images were not imported so I then enabled imagemagick and manually uploaded them. The sort fuction now works fine. I haven't tried another upload yet. I will post an update when I do.

  • 0
Posted

Disabling and enabling ImageMagick did not fix the upload problem. The import still fails if the module is enabled (without an error message). When it is disabled the products are imported but not all the photos.

  • 0
Posted

@mdekker The source files were not imported correctly, that is why I got the error and could not sort. By disabling ImageMagick and reimporting the file it fixed that problem. It seems it is a problem with the image import on 1.0.3. I am going to dig around a bit more and see if I can find the problem.

  • 0
Posted

I downloaded 1.0.3 to my computer and checked the files in the download against the files on the server and found that there seemed to be quite a few which had differences. So I uploaded the files from my computer to the server using filezilla set to skip any which were the same size. I just did an upload and it went through without a hitch, so something must not have updated correctly with the upgrade module.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...