Jump to content

Problem with background color??


Recommended Posts

Tnx for advice but i try that before i ask here on forum. I can change anything via firebug except that black default area.
I send you pm with link of my site. I hope that you will give me solution. If anybody have some solutions for this please answer or send me pm for link of web site. tnx

Link to comment
Share on other sites

(sorry for my english, i'm french)
Your black areas are included in your images.
I dont know yet where it can come. Maybe a Prestashop setting ...


Tnx anyway but what i notice is if the picture is for example 200x200, 211x212 or 194x194 then is everything ok and there is no black area. Width and height must be equeal. That is stupid but what can i do. There must be somewere in css i think to change color of that black area if the picture is smaller than some number or width and height are not equeal.
Link to comment
Share on other sites

I do not think this is a problem with the CSS because the black is directly in the image.

I found it on the forum (topic)
I think your problem is something like this ...

good luck ;o)



si jamais pour info, ça pourra peut-être aider certains qui ont comme moi télécharger la version 1.1

le code n’est plus dans le fichier functions.php mais dans le fichier : images.inc.php (à la racine)
ligne 156…

$white = imagecolorallocate($destImage, 255, 255, 255);



pour changer la couleur de fond c’est le même principe que ce que Jude a donné dans le post juste au dessus…

Link to comment
Share on other sites

In fact to make it simple ...
Prestashop resizes and crops images of products that you give it, and makes a square format. That's why when you give her squares images the black doesn't appear. If your pictures are rectangles, it complete it with black to make the image square (that's how that works PrestaShop).

After trying my amendment, you may need to re-generate your pictures in the Back Office of PrestaShop...

Link to comment
Share on other sites

As-tu fait des modifications particulières dans tes fichiers ?
Cela me parait bizarre que Prestashop, sans raisons particulière, modifie la couleur qu'il applique lors du redimensionnement des images...

Quelle version de Prestashop utilises-tu ?

----

Have you made specific changes in your files?
That seems strange that PrestaShop, without special reasons, it changes the color applied when resizing images ...

Which version of PrestaShop do you use?

Link to comment
Share on other sites

Oui j’ai bien le même problème confused : http://www.lesdelicesduchai.fr


J'ai vu sur ton site que certaines de tes images étaient normales (blanches -> http://www.lesdelicesduchai.fr/product.php?id_product=29).
Ton problème n'est donc pas présent depuis le début sur ta boutique ?
Essais de déterminer la date de dysfonctionnement en te basant sur les dates de création des produits, peut-être que ça t'aideras...

---

I saw on your site that some of your images were normal (white -> [url = http://www.lesdelicesduchai.fr/product.php?id_product=29] http://www.lesdelicesduchai.fr/product . php? id_product = 29 [/ url]).
Your problem isn't present since the beginning of your shop?
Tests to determine the date of dysfunction, based you on the dates of creation of products, maybe it will help you ...
Link to comment
Share on other sites

I do not think this is a problem with the CSS because the black is directly in the image.

I found it on the forum (topic)
I think your problem is something like this …

good luck ;o)

si jamais pour info, ça pourra peut-être aider certains qui ont comme moi télécharger la version 1.1

le code n’est plus dans le fichier functions.php mais dans le fichier : images.inc.php (à la racine)
ligne 156…

$white = imagecolorallocate($destImage, 255, 255, 255);



pour changer la couleur de fond c’est le même principe que ce que Jude a donné dans le post juste au dessus…



Tu as essayé avec ça ?
Link to comment
Share on other sites

Oui oui : c'est ça mon GROS problème ; regarde le code entier du RESIZE :

function imageResize($sourceFile, $destFile, $destWidth = NULL, $destHeight = NULL, $fileType = 'jpg')
{
   list($sourceWidth, $sourceHeight, $type, $attr) = getimagesize($sourceFile);
   if (!$sourceWidth)
       return false;
   if ($destWidth == NULL) $destWidth = $sourceWidth;
   if ($destHeight == NULL) $destHeight = $sourceHeight;

   $sourceImage = createSrcImage($type, $sourceFile);

   $widthDiff = $destWidth / $sourceWidth;
   $heightDiff = $destHeight / $sourceHeight;

   if ($widthDiff > 1 AND $heightDiff > 1)
   {
       $nextWidth = $sourceWidth;
       $nextHeight = $sourceHeight;
   }
   else
   {
       if (intval(Configuration::get('PS_IMAGE_GENERATION_METHOD')) == 2 OR (intval(Configuration::get('PS_IMAGE_GENERATION_METHOD')) == 0 AND $widthDiff > $heightDiff))
       {
           $nextHeight = $destHeight;
           $nextWidth = intval(($sourceWidth * $nextHeight) / $sourceHeight);
           $destWidth = (intval(Configuration::get('PS_IMAGE_GENERATION_METHOD')) == 0 ? $destWidth : $nextWidth);
       }
       else
       {
           $nextWidth = $destWidth;
           $nextHeight = intval($sourceHeight * $destWidth / $sourceWidth);
           $destHeight = (intval(Configuration::get('PS_IMAGE_GENERATION_METHOD')) == 0 ? $destHeight : $nextHeight);
       }
   }

   $borderWidth = intval(($destWidth - $nextWidth) / 2);
   $borderHeight = intval(($destHeight - $nextHeight) / 2);

   $destImage = imagecreatetruecolor($destWidth, $destHeight);

   $white = imagecolorallocate($destImage, 255, 255, 255);
   imagefill($destImage, 0, 0, $white);

   imagecopyresampled($destImage, $sourceImage, $borderWidth, $borderHeight, 0, 0, $nextWidth, $nextHeight, $sourceWidth, $sourceHeight);
   imagecolortransparent($destImage, $white);
   return (returnDestImage($fileType, $destImage, $destFile));



Il me semble parfait ; et pourtant il génère des vignettes avec fond noir :-/

Link to comment
Share on other sites

http://www.prestashop.com/forums/viewthread/35584/P0/integration/fond_des_photos_noir_alorq_quils_etaient_blancs

Dans ce topic il semble qu'il s'agisse d'un problème de version de la librairie GD.
Tu peux le suivre pour la mettre à jour, peut-être que ça vient de là...

---

In this topic it seems to be a problem with the version of the GD library.
You can follow it for update, maybe it comes from there ...
Link to comment
Share on other sites

Bon, ben je commence vraiment à desespérer ... c'est une solution "bout de ficelle" : ça étire les photos :-(
Donc pas ça ...

QUELQU'UN A UN TUYAU ????? Parce que là c'est vraiment bizarre que du jour au lendemain ça fasse ça !

Link to comment
Share on other sites

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...